Skip to content

Commit

Permalink
// in FF when the verb is HEAD, the body is null
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelsavara committed Feb 28, 2025
1 parent 2366fb9 commit 89c5fba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mono/browser/runtime/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ export function http_wasm_get_streamed_response_bytes (controller: HttpControlle
return wrap_as_cancelable_promise(async () => {
await controller.responsePromise;
mono_assert(controller.response, "expected response");
mono_assert(controller.response.body, "expected response.body");
if (!controller.response.body) {
// in FF when the verb is HEAD, the body is null
return 0;
}
if (!controller.streamReader) {
controller.streamReader = controller.response.body.getReader();
mute_unhandledrejection(controller.streamReader.closed);
Expand Down

2 comments on commit 89c5fba

@campersau
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about here?

mono_assert(controller.response.body, "expected response.body");

@pavelsavara
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

Please sign in to comment.