mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
Fixing header conversion from Header to plain object (#1290)
This commit is contained in:
parent
ab3b7f0888
commit
08ea0448ad
@ -10,15 +10,10 @@ import {
|
||||
} from '@gitbeaker/requester-utils';
|
||||
|
||||
function responseHeadersAsObject(response): Record<string, string> {
|
||||
if (!response.headers.entries().length) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const headers = {};
|
||||
const keyVals = [...response.headers.entries()];
|
||||
|
||||
keyVals.forEach(([key, val]) => {
|
||||
headers[key] = val;
|
||||
Array.from(response.headers.entries()).forEach(([key, value]) => {
|
||||
headers[key] = value;
|
||||
});
|
||||
|
||||
return headers;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user