Skip to content

Commit 59e4439

Browse files
vicky1999bluwyRich-Harris
authored
#3505 - json response condition update (#3624)
* #3505 - json response condition update * Update packages/kit/src/runtime/server/endpoint.js Co-authored-by: Bjorn Lu <[email protected]> * changeset added * Update light-pumas-heal.md Co-authored-by: Bjorn Lu <[email protected]> Co-authored-by: Rich Harris <[email protected]>
1 parent 48f4816 commit 59e4439

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/light-pumas-heal.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
Handle non-compliant ReadableStream implementations

packages/kit/src/runtime/server/endpoint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function is_pojo(body) {
116116
if (body._readableState && body._writableState && body._events) return false;
117117

118118
// similarly, it could be a web ReadableStream
119-
if (body[Symbol.toStringTag] === 'ReadableStream') return false;
119+
if (typeof ReadableStream !== 'undefined' && body instanceof ReadableStream) return false;
120120
}
121121

122122
return true;

0 commit comments

Comments
 (0)