code quality
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
This commit is contained in:
@@ -47,9 +47,10 @@ function buildSetCookieHeader(options: {
|
||||
return parts.join('; ');
|
||||
}
|
||||
|
||||
function appendSetCookieHeader(existing: string | string[] | undefined, next: string): string[] {
|
||||
function appendSetCookieHeader(existing: string | number | string[] | undefined, next: string): string[] {
|
||||
if (!existing) return [next];
|
||||
if (Array.isArray(existing)) return [...existing, next];
|
||||
if (typeof existing === 'number') return [existing.toString(), next];
|
||||
return [existing, next];
|
||||
}
|
||||
|
||||
@@ -111,7 +112,7 @@ export class CookieIdentitySessionAdapter implements IdentitySessionPort {
|
||||
});
|
||||
|
||||
const existing = ctx.res.getHeader('Set-Cookie');
|
||||
ctx.res.setHeader('Set-Cookie', appendSetCookieHeader(existing as any, setCookie));
|
||||
ctx.res.setHeader('Set-Cookie', appendSetCookieHeader(existing, setCookie));
|
||||
}
|
||||
|
||||
return session;
|
||||
@@ -137,7 +138,7 @@ export class CookieIdentitySessionAdapter implements IdentitySessionPort {
|
||||
});
|
||||
|
||||
const existing = ctx.res.getHeader('Set-Cookie');
|
||||
ctx.res.setHeader('Set-Cookie', appendSetCookieHeader(existing as any, setCookie));
|
||||
ctx.res.setHeader('Set-Cookie', appendSetCookieHeader(existing, setCookie));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user