Skip to content

Commit

Permalink
remove blob() call from jshttp.ToResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
syumai committed Feb 1, 2024
1 parent 94f29eb commit bf3ab8e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions internal/jshttp/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ func toResponse(res js.Value, body io.ReadCloser) (*http.Response, error) {
// ToResponse converts JavaScript sides Response to *http.Response.
// - Response: https://developer.mozilla.org/docs/Web/API/Response
func ToResponse(res js.Value) (*http.Response, error) {
promise := res.Call("blob")
blob, err := jsutil.AwaitPromise(promise)
if err != nil {
return nil, err
}
body := jsutil.ConvertReadableStreamToReadCloser(blob.Call("stream"))
body := jsutil.ConvertReadableStreamToReadCloser(res.Get("body"))
return toResponse(res, body)
}

Expand Down

0 comments on commit bf3ab8e

Please sign in to comment.