Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
gtm-nayan committed Apr 11, 2023
1 parent a18e69e commit e692574
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/kit/src/exports/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,16 @@ export async function getRequest({ request, base, bodySizeLimit }) {

/** @type {import('@sveltejs/kit/node').setResponse} */
export async function setResponse(res, response) {
for (const key of response.headers.keys()) {
for (const [key, value] of response.headers) {
try {
const value = /** @type {string} */ (response.headers.get(key));
res.setHeader(
key,
key === 'set-cookie' ? set_cookie_parser.splitCookiesString(value) : value
key === 'set-cookie'
? set_cookie_parser.splitCookiesString(
// This is absurd but necessary, TODO: investigate why
/** @type {string}*/ (response.headers.get(key))
)
: value
);
} catch (error) {
res.getHeaderNames().forEach((name) => res.removeHeader(name));
Expand Down

0 comments on commit e692574

Please sign in to comment.