[ci] format
This commit is contained in:
parent
4b0f27d9ff
commit
7ada6280f2
1 changed files with 3 additions and 3 deletions
|
@ -49,15 +49,15 @@ async function writeWebResponse(res: http.ServerResponse, webResponse: Response)
|
||||||
const { status, headers, body } = webResponse;
|
const { status, headers, body } = webResponse;
|
||||||
|
|
||||||
let _headers = {};
|
let _headers = {};
|
||||||
if('raw' in headers) {
|
if ('raw' in headers) {
|
||||||
// Node fetch allows you to get the raw headers, which includes multiples of the same type.
|
// Node fetch allows you to get the raw headers, which includes multiples of the same type.
|
||||||
// This is needed because Set-Cookie *must* be called for each cookie, and can't be
|
// This is needed because Set-Cookie *must* be called for each cookie, and can't be
|
||||||
// concatenated together.
|
// concatenated together.
|
||||||
type HeadersWithRaw = Headers & {
|
type HeadersWithRaw = Headers & {
|
||||||
raw: () => Record<string, string[]>
|
raw: () => Record<string, string[]>;
|
||||||
};
|
};
|
||||||
|
|
||||||
for(const [key, value] of Object.entries((headers as HeadersWithRaw).raw())) {
|
for (const [key, value] of Object.entries((headers as HeadersWithRaw).raw())) {
|
||||||
res.setHeader(key, value);
|
res.setHeader(key, value);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue