Open coyotte508 opened 1 year ago
The content negotiation seems to be working as intended, but our route handling logic doesn't check if any actions exist first before skipping past our endpoints.
On a side note, this is what the accept header look like for a native form submission request:
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Describe the problem
I want to do a
+server.ts
with aPOST
handler that downloads a file (a JSON backup).And I want it to be accessible without client-side javascript:
Unfortunately, there is a 405 error message with the message:
This, despite the lack of
+page.server.ts
/ actions.Describe the proposed solution
When there is no actions for a page, allow the POST from the native browser form to hit
+server.ts
'sPOST
handler.This would be consistent with the GET behavior.
Alternatives considered
Currently, workarounds are using client-side javascript, or redirecting to a GET page in the action's handler.
A possible alternative feature is allow downloading files in an action handler.
Importance
nice to have
Additional Information
No response