+server.js
This project was created using pnpm create svelte
.
When using prerender
within a +server.js
file and attempting to execute a SEMRush cURL command a 405 Method not allowed
is returned, however when using prerender
with a +page.server.js
file a 200 OK
is returned (which is expected).
We've also noticed then when sending the cURL request with -H 'Accept: text/html'
+server.js
will return 200 OK
.
A 200 OK
response should be returned even with +server.js
.
A 405 Method not allowed
is currently returned when using +server.js
.
Reproducing the bug seems to be fairly easy:
export const prerender = true
to src/routes/+server.js
echo 'export const prerender = true' > 'src/routes/+server.js'
pnpm build
pnpm preview
curl http://localhost:4173
curl -H 'Accept: text/html' http://localhost:4173