Skip to content

Commit

Permalink
refactor: rename misleading util function
Browse files Browse the repository at this point in the history
It normalizes all response headers, not just `set-cookie`.
  • Loading branch information
serhalp committed May 1, 2024
1 parent aabdc9c commit 4541cf9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ export function normalizeFetchResponse(response: Response) {
return new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers: normalizeCookieHeaders(response.headers),
headers: normalizeResponseHeaders(response.headers),
});
}

export function normalizeCookieHeader(header: number | string | string[] = "") {
return splitCookiesString(joinHeaders(header));
}

export function normalizeCookieHeaders(headers: Headers) {
export function normalizeResponseHeaders(headers: Headers) {
const outgoingHeaders = new Headers();
for (const [name, header] of headers) {
if (name === "set-cookie") {
Expand Down

0 comments on commit 4541cf9

Please sign in to comment.