Skip to content

Commit ff384cb

Browse files
fix(http): handle status code 204 to use js null fix #2580 (#2636)
* fix(http): handle status code 204 to use javascript null * add change file --------- Co-authored-by: Lucas Nogueira <[email protected]>
1 parent 4bb51b3 commit ff384cb

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.changes/http-fix-204.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"http": patch
3+
"http-js": patch
4+
---
5+
6+
Properly handle responses with status code 204.

plugins/http/api-iife.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/http/guest-js/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export async function fetch(
262262
}
263263
})
264264

265-
const res = new Response(readableStreamBody, {
265+
const res = new Response(status !== 204 ? readableStreamBody : null, {
266266
status,
267267
statusText
268268
})

0 commit comments

Comments
 (0)