Skip to content

Commit

Permalink
Fixing header conversion from Header to plain object (#1290)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalrymple authored Oct 30, 2020
1 parent ab3b7f0 commit 08ea044
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/gitbeaker-browser/src/KyRequester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 08ea044

Please sign in to comment.