Skip to content

Commit

Permalink
Check request[bodyInternals] before accessing size.
Browse files Browse the repository at this point in the history
  • Loading branch information
onurtemizkan committed Jan 14, 2024
1 parent 0f29581 commit a922ec0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/remix/src/utils/web-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const normalizeRemixRequest = (request: RemixRequest): Record<string, any
contentLengthValue = '0';
}

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

0 comments on commit a922ec0

Please sign in to comment.