Reduce spurious logs for headers our clients send

This commit is contained in:
Manav Rathi
2024-06-17 09:02:55 +05:30
parent d5a8586152
commit 80b34f1aef

View File

@@ -31,7 +31,7 @@ const handleOPTIONS = (request: Request) => {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "POST, PUT, OPTIONS",
"Access-Control-Max-Age": "86400",
// "Access-Control-Allow-Headers": "UPLOAD-URL",
// "Access-Control-Allow-Headers": "Content-Type", "UPLOAD-URL, X-Client-Package",
"Access-Control-Allow-Headers": "*",
"Access-Control-Expose-Headers": "X-Request-Id, CF-Ray",
},
@@ -58,7 +58,7 @@ const isAllowedOrigin = (origin: string | null) => {
};
const areAllowedHeaders = (headers: string | null) => {
const allowed = ["UPLOAD-URL"];
const allowed = ["Content-Type", "UPLOAD-URL", "X-Client-Package"];
if (!headers) return true;
for (const header of headers.split(",")) {