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
A list of allowed methods should be returned when making an invalid request to an endpoint.
However, no exported methods are being included in the allow header.
Describe the bug
A list of allowed methods should be returned when making an invalid request to an endpoint.
However, no exported methods are being included in the
allow
header.kit/packages/kit/src/runtime/server/utils.js
Line 44 in 51cd6e6
The issue stems from the
in
keyword comparing the index numbers instead of the http methods in the array. It should use theof
keyword instead.https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-v8r3ub?file=src%2Froutes%2F%2Bpage.svelte,src%2Froutes%2Ftest%2F%2Bserver.js&terminal=dev
Make a request to
/test
with a method that is not allowed such asPUT
Expected:
Response's
allow
header includesPOST
.Actual:
Response's
allow
header is empty.Logs
#### Browser console Failed to load resource: the server responded with a status of 405 (Method Not Allowed)
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: