Open yaronya opened 2 years ago
We switched to using the fetch API, which means that response.headers
is a Headers
instance, which is iterable.
That whole for
loop can be simplified to use a simple Object.fromEntries()
Can you describe what the response.headers
looks like for you? Is it a simple object
?
@yaronya Is this still an issue?
I hit this issue also in #711
A plain object is not iterable. We could rewrite it, to accept plain objects, but on the other hand we want definetly set the condition to use a fetch implementation according to the spec.
Hi,
I'm using
@octokit/rest
as my GH rest client and I found a possible bug in https://github.com/octokit/request.js/blob/92e7e1c6609b694ba3cf69fa7a86efd9dbc6e5f3/src/fetch-wrapper.ts#L50 where I use a fetch wrapper that returnheaders
as a non-iterable object. In that case,@octokit/request
throws an error sayingresponse.headers is not iterable
.I'd expect the package to iterate the
headers
attribute only if it exists and is iterable...