mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
PS-1230 PS-1152 Fix/improve null origin message (#3280)
* Improve message if Origin header value is empty * PS-1230 Remove serve feature flag
This commit is contained in:
@@ -6,6 +6,7 @@ import * as koaBodyParser from "koa-bodyparser";
|
||||
import * as koaJson from "koa-json";
|
||||
|
||||
import { KeySuffixOptions } from "@bitwarden/common/enums/keySuffixOptions";
|
||||
import { Utils } from "@bitwarden/common/misc/utils";
|
||||
import { Response } from "@bitwarden/node/cli/models/response";
|
||||
import { FileResponse } from "@bitwarden/node/cli/models/response/fileResponse";
|
||||
|
||||
@@ -167,7 +168,13 @@ export class ServeCommand {
|
||||
.use(async (ctx, next) => {
|
||||
if (protectOrigin && ctx.headers.origin != undefined) {
|
||||
ctx.status = 403;
|
||||
this.main.logService.warning(`Blocking request from ${ctx.headers.origin}`);
|
||||
this.main.logService.warning(
|
||||
`Blocking request from "${
|
||||
Utils.isNullOrEmpty(ctx.headers.origin)
|
||||
? "(Origin header value missing)"
|
||||
: ctx.headers.origin
|
||||
}"`
|
||||
);
|
||||
return;
|
||||
}
|
||||
await next();
|
||||
|
||||
Reference in New Issue
Block a user