Skip to content

Commit 042e6f0

Browse files
committed
set rawBody to null when body is nullish in simulated load fetch (sveltejs#2294)
1 parent 5777cda commit 042e6f0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/kit/src/runtime/server/page/load_node.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ export async function load_node({
151151
method: opts.method || 'GET',
152152
headers,
153153
path: relative,
154-
rawBody: new TextEncoder().encode(/** @type {string} */ (opts.body)),
154+
rawBody:
155+
opts.body == null
156+
? null
157+
: new TextEncoder().encode(/** @type {string} */ (opts.body)),
155158
query: new URLSearchParams(search)
156159
},
157160
options,

0 commit comments

Comments
 (0)