[ci] format

This commit is contained in:
matthewp 2022-04-07 19:18:48 +00:00 committed by GitHub Actions
parent 4b0f27d9ff
commit 7ada6280f2

View file

@ -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 {