Skip to content

Commit f15ebc9

Browse files
committed
Check request[bodyInternals] before accessing size.
1 parent 0f29581 commit f15ebc9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/remix/src/utils/web-fetch.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable complexity */
12
// Based on Remix's implementation of Fetch API
23
// https://github.com/remix-run/web-std-io/blob/d2a003fe92096aaf97ab2a618b74875ccaadc280/packages/fetch/
34
// The MIT License (MIT)
@@ -88,7 +89,7 @@ export const normalizeRemixRequest = (request: RemixRequest): Record<string, any
8889
contentLengthValue = '0';
8990
}
9091

91-
if (request.body !== null) {
92+
if (request.body !== null && request[bodyInternalsSymbol]) {
9293
const totalBytes = request[bodyInternalsSymbol].size;
9394
// Set Content-Length if totalBytes is a number (that is not NaN)
9495
if (typeof totalBytes === 'number' && !Number.isNaN(totalBytes)) {

0 commit comments

Comments
 (0)