Skip to content

Commit

Permalink
git: fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyhalight committed Jan 9, 2025
2 parents 36ab540 + bbc65e6 commit 3ce13ce
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dist/vot-min.user.js

Large diffs are not rendered by default.

20 changes: 12 additions & 8 deletions dist/vot.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2580,17 +2580,21 @@ async function GM_fetch(url, opts = {}) {
timeout,
headers: Object.fromEntries(new Headers(fetchOptions.headers || {})),
onload: (resp) => {
const headers = {};
resp.responseHeaders
.trim()
.split(/\r?\n/)
.forEach((line) => {
const [name, value] = line.split(/:\s*/);
if (name && value) {
headers[name.trim()] = value.trim();
}
});

resolve(
new Response(resp.response, {
status: resp.status,
headers: new Headers(
Object.fromEntries(
resp.responseHeaders
.trim()
.split(/\r?\n/)
.map((line) => line.split(/:\s*/)),
),
),
headers: new Headers(headers),
}),
);
},
Expand Down
20 changes: 12 additions & 8 deletions src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,21 @@ async function GM_fetch(url, opts = {}) {
timeout,
headers: Object.fromEntries(new Headers(fetchOptions.headers || {})),
onload: (resp) => {
const headers = {};
resp.responseHeaders
.trim()
.split(/\r?\n/)
.forEach((line) => {
const [name, value] = line.split(/:\s*/);
if (name && value) {
headers[name.trim()] = value.trim();
}
});

resolve(
new Response(resp.response, {
status: resp.status,
headers: new Headers(
Object.fromEntries(
resp.responseHeaders
.trim()
.split(/\r?\n/)
.map((line) => line.split(/:\s*/)),
),
),
headers: new Headers(headers),
}),
);
},
Expand Down

0 comments on commit 3ce13ce

Please sign in to comment.