You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ curl localhost:3000/xxx --header "Content-Type: application/xml" -v --data '<x></x>'
* Trying ::1...
* TCP_NODELAY set
* Connection failed
* connect to ::1 port 3000 failed: Connection refused
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 3000 (#0)
> POST /xxx HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Type: application/xml
> Content-Length: 7
>
* upload completely sent off: 7 out of 7 bytes
< HTTP/1.1 500 Internal Server Error
< Access-Control-Allow-Origin: *
< Date: Tue, 18 May 2021 19:44:40 GMT
< Connection: keep-alive
< Keep-Alive: timeout=5
< Transfer-Encoding: chunked
<
Error: Invalid Content-Type application/xml
at parse_body (file:///Users/olojkine/Developpement/sanipasse/node_modules/@sveltejs/kit/dist/ssr.js:1402:11)
at respond (file:///Users/olojkine/Developpement/sanipasse/node_modules/@sveltejs/kit/dist/ssr.js:1514:11)
at Immediate.<anonymous> (file:///Users/olojkine/Developpement/sanipasse/node_modules/@sveltejs/kit/dist/chunks/index.js:3305:29)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)* Closing connection 0
* Connection #0 to host localhost left intact
Stacktraces
Stack trace
Error: Invalid Content-Type application/xml
at parse_body (file:///Users/olojkine/Developpement/sanipasse/node_modules/@sveltejs/kit/dist/ssr.js:1402:11)
at respond (file:///Users/olojkine/Developpement/sanipasse/node_modules/@sveltejs/kit/dist/ssr.js:1514:11)
at Immediate.<anonymous> (file:///Users/olojkine/Developpement/sanipasse/node_modules/@sveltejs/kit/dist/chunks/index.js:3305:29)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Describe the bug
When posting data with the content-type
application/xml
, SvelteKit throws an error.Logs
To Reproduce
In the default sveltekit app, run
npm run dev
, then, from a terminal :Expected behavior
A 404 error
Actual behavior
A 500 error
Stacktraces
Stack trace
Information about your SvelteKit Installation:
Diagnostics
Severity
Just annoying for me, blocking for anyone who wants to migrate an api that accepts xml to sveltekit.
Additional context
This bug was already reported in #852, which contained enough information for reproduction, but was closed without investigation.
The text was updated successfully, but these errors were encountered: