x-client-package

Albums app is using the old axios layer which is passing "x-client-package",
will also allow that for now
This commit is contained in:
Manav Rathi 2024-06-16 10:06:22 +05:30
parent b781f33e4b
commit 290564c973
No known key found for this signature in database

View File

@ -26,6 +26,7 @@ const handleOPTIONS = (request: Request) => {
"Access-Control-Allow-Methods": "GET, OPTIONS",
"Access-Control-Max-Age": "86400",
// "Access-Control-Allow-Headers": "X-Auth-Access-Token, X-Auth-Access-Token-JWT",
// "Access-Control-Allow-Headers": "X-Auth-Access-Token, X-Auth-Access-Token-JWT, x-client-package",
"Access-Control-Allow-Headers": "*",
},
});
@ -45,7 +46,12 @@ const isAllowedOrigin = (origin: string | null) => {
};
const areAllowedHeaders = (headers: string | null) => {
const allowed = ["x-auth-access-token", "x-auth-access-token-jwt"];
// TODO(MR): Stop sending "x-client-package"
const allowed = [
"x-auth-access-token",
"x-auth-access-token-jwt",
"x-client-package",
];
if (!headers) return true;
for (const header of headers.split(",")) {