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
In formaction docs it says to use syntax like ?/actionName to call a different action. That name is automatically mapped to the actions object in +page.server.js
The problem is that some api gateways and load balancers will reject the unescaped forward slash, while locally it works perfectly fine. I encountered this issue when deploying svelte kit to AWS Lambda, the request with ?/action init failed with x-amzn-ErrorType: InvalidQueryStringException error before even reaching the app.
Describe the proposed solution
formaction to be automatically url encoded. It would turn ?/action into ?%2Faction.
When using use:enhance, the action field passed in the callback should be automatically decoded too, to turn it back into the original string.
Alternatives considered
There's a couple of alternatives
Manually encoding the uri. Makes it harder to type and not as clear. Since it works without escaping most of the time and can fail in production is still kind of a footgun
Use a different symbol instead of / to denote a different action. I'm not sure what it could be though.
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Describe the problem
In formaction docs it says to use syntax like
?/actionName
to call a different action. That name is automatically mapped to theactions
object in +page.server.jsThe problem is that some api gateways and load balancers will reject the unescaped forward slash, while locally it works perfectly fine. I encountered this issue when deploying svelte kit to AWS Lambda, the request with
?/action
init failed withx-amzn-ErrorType: InvalidQueryStringException
error before even reaching the app.Describe the proposed solution
formaction
to be automatically url encoded. It would turn?/action
into?%2Faction
.When using
use:enhance
, theaction
field passed in the callback should be automatically decoded too, to turn it back into the original string.Alternatives considered
There's a couple of alternatives
/
to denote a different action. I'm not sure what it could be though.Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: