Skip to content

Commit

Permalink
fix(fetchDevel): use std Headers methods in contentObj (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadicc committed Oct 24, 2024
1 parent b06e26b commit 46273db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/fetchDevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ async function fetchDevel(url, fetchOptions) {
if (error.code === "ENOENT") {
const res = await fetch(origUrl, fetchOptions);

const responseHeaders = Object.fromEntries(res.headers.entries());
if (responseHeaders["set-cookie"]) {
responseHeaders["set-cookie"] = responseHeaders.getSetCookie();
}

contentObj = {
request: {
url: url,
Expand All @@ -78,7 +83,7 @@ async function fetchDevel(url, fetchOptions) {
ok: res.ok,
status: res.status,
statusText: res.statusText,
headers: res.headers.raw(),
headers: responseHeaders,
// body: await res.text(),
},
};
Expand Down

0 comments on commit 46273db

Please sign in to comment.