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

This commit is contained in:
2026-01-26 12:52:24 +01:00
parent f877f821ef
commit cfc30c79a8
62 changed files with 227 additions and 173 deletions

View File

@@ -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;
}