Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

400 Bad Request / InvalidQueryStringException Error when using Nova and Laravel Vapor #5339

Open
amcfarlane opened this issue Feb 20, 2023 · 2 comments
Labels
documentation Documentation issue

Comments

@amcfarlane
Copy link

  • Laravel Version: 9.48.0
  • Nova Version: 4.22.0

When you try to detach a MorphToMany field when using Laravel Vapor and Nova you get the following error:

Request URL: https://example.lambda-url.us-example-1.on.aws/nova-api/users/detach?search=&filters=W10%3D&trashed=&viaResource=cars&viaResourceId=3&viaRelationship=&resources[]=11
Request Method: DELETE
Status Code: 400 Bad Request

Connection: keep-alive
Content-Length: 16
Content-Type: application/json
Date: Mon, 20 Feb 2023 14:54:20 GMT
x-amzn-ErrorType: InvalidQueryStringException
x-amzn-RequestId: example-2078-491f-ac60-7d36acfe2922

This is due to the double bracket within "resources[]", a limitation of the API Gateway Lambda Proxy. It may need "percent-encoding" of the query string to work.

https://stackoverflow.com/questions/53371401/invalidquerystringexception-on-aws-iam-secured-api-gateway-lambda-proxy

@amcfarlane
Copy link
Author

Vapor support got back to me and is a limitation of the function URLs provided by Lambda. I updated to a custom/vanity domain and this fixed the issue. May be worth highlighting somewhere in the docs that default Nova doesn't play well with the free version of Vapor. Or maybe amend Nova so it works out of the box with function URLs provided by Lambda.

@crynobone crynobone added the documentation Documentation issue label Feb 21, 2023
@crynobone
Copy link
Member

The URLs are generated via Axios, I'll talk with the team regarding where's the best place to document this limitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation issue
Projects
None yet
Development

No branches or pull requests

2 participants