From 4541cf993ce6e176f899a7df7898f59bdeef9a90 Mon Sep 17 00:00:00 2001 From: Philippe Serhal Date: Wed, 24 Apr 2024 15:43:10 -0400 Subject: [PATCH] refactor: rename misleading util function It normalizes all response headers, not just `set-cookie`. --- src/runtime/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/utils.ts b/src/runtime/utils.ts index 244f2dd4dd..3f21344fe6 100644 --- a/src/runtime/utils.ts +++ b/src/runtime/utils.ts @@ -115,7 +115,7 @@ export function normalizeFetchResponse(response: Response) { return new Response(response.body, { status: response.status, statusText: response.statusText, - headers: normalizeCookieHeaders(response.headers), + headers: normalizeResponseHeaders(response.headers), }); } @@ -123,7 +123,7 @@ 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") {