try to force header order

This commit is contained in:
Moon Man 2023-12-31 06:39:15 -05:00
parent 563df3018c
commit 16f42e5cd9
1 changed files with 3 additions and 3 deletions

View File

@ -55,18 +55,18 @@ export const signedFetch = async (url: string, init: RequestInit, signedInit: Si
headers: signedHeaders
});
const newHeaders = new Headers(
const newHeaders: HeadersInit =
[
...signedHeaders,
["Signature", signature],
["Content-Type", `application/ld+json; profile="${CONTEXT}"`]
]
);
;
if (Array.isArray(init.headers))
init.headers
.filter((header) => Array.isArray(header))
.forEach(([key, value]) => newHeaders.set(key, value));
.forEach(([key, value]) => newHeaders.push([key, value]));
console.log("Headers:");
for (const [key, value] of newHeaders) {