Skip to content

Commit

Permalink
fix: FetchResponse type (#113)
Browse files Browse the repository at this point in the history
* fix: FetchResponse type

* Update packages/transport/src/http.js

Co-authored-by: Irakli Gozalishvili <[email protected]>
  • Loading branch information
hugomrdias and Gozala authored Oct 13, 2022
1 parent 8ed7777 commit 9397eb6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/transport/src/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import * as API from '@ucanto/interface'
* ok: boolean
* arrayBuffer():API.Await<ArrayBuffer>
* headers: {
* entries():Iterable<[string, string]>
* }
* entries?: () => Iterable<[string, string]>
* } | Headers
* status?: number
* statusText?: string
* url?: string
Expand Down Expand Up @@ -62,7 +62,10 @@ class Channel {
: HTTPError.throw('HTTP Request failed', response)

return {
headers: Object.fromEntries(response.headers.entries()),
headers: response.headers.entries
? Object.fromEntries(response.headers.entries())
/* c8 ignore next */
: {},
body: new Uint8Array(buffer),
}
}
Expand Down

0 comments on commit 9397eb6

Please sign in to comment.