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

ArrayIndexOutOfBounds when parsing query string with no value #363

Closed
sapessi opened this issue Jul 15, 2020 · 4 comments
Closed

ArrayIndexOutOfBounds when parsing query string with no value #363

sapessi opened this issue Jul 15, 2020 · 4 comments
Assignees
Labels
Milestone

Comments

@sapessi
Copy link
Collaborator

sapessi commented Jul 15, 2020

  • Framework version: 1.5
  • Implementations: Any

Scenario

When sending a request that contains a query string parameter with no value AwsHttpApiV2ProxyHttpServletRequest throws an ArrayIndexOutOfBoundsException

Expected behavior

Parses the query string correctly and sets a null value for the parameter name

Steps to reproduce

Create an application that receives a query string parameter behind AWS HTTP APIs and send a request with the parameter, the = value separator, and no value:
`curl https://sample-api/params?user=

Full log output

ERROR 1 --- [main] c.a.s.p.internal.LambdaContainerHandler  : Error while handling request
java.lang.ArrayIndexOutOfBoundsException: 1
at com.amazonaws.serverless.proxy.internal.servlet.AwsHttpApiV2ProxyHttpServletRequest.parseRawQueryString(AwsHttpApiV2ProxyHttpServletRequest.java:492)
@sapessi sapessi self-assigned this Jul 15, 2020
@sapessi sapessi added the bug label Jul 15, 2020
@sapessi sapessi added this to the Release 1.5.1 milestone Jul 15, 2020
sapessi added a commit that referenced this issue Jul 15, 2020
…PI support where we have a query string key, followed by a value declarator (=), but then no value
@srp321
Copy link

srp321 commented Jul 15, 2020

@sapessi seems that you already raised and fixed the bug I was opening (which I had reported to AWS support a few hours back).
I'll close the one I had raised.
Also, is there any timeline as to when the fixed version will be available for usage?
or any workaround for now?

@sapessi
Copy link
Collaborator Author

sapessi commented Jul 15, 2020

Yeah @srp321 - I created this because support contacted me. I hope to have a 1.5.1 path release out today - latest tomorrow. I'll update this issue once it's done.

@srp321
Copy link

srp321 commented Jul 15, 2020

Yeah @srp321 - I created this because support contacted me. I hope to have a 1.5.1 path release out today - latest tomorrow. I'll update this issue once it's done.

that's great news!
Thanks for the prompt fix

sapessi added a commit that referenced this issue Jul 15, 2020
* fix: Adding pathParameters to v2 proxy event as reported in #358.

* fix: Address JSON content type issue reported in #352 and #344

* fix: Fixed bug caught by integration tests for #352

* fix: Fix struts tests for the changes made for #352

* test: Attempting to replicate the issue reported in #342

* test: Reverting exception test in Spring package since it's only available in Spring5, not Spring4

* fix: Sigh, forgot to remove the import for the class that doesn't exist from the previous commit

* fix: Addresses bug reported in query string parsing (#363) for HTTP API support where we have a query string key, followed by a value declarator (=), but then no value

* chore: Update GitHub issue and PR templates

* fix: Fixed issue reported by SpotBugs with the exception logging of the HTTP API query string parsing
@sapessi
Copy link
Collaborator Author

sapessi commented Jul 15, 2020

Release 1.5.1 is making its way to maven central and should be available later today. 🚀

@sapessi sapessi closed this as completed Jul 15, 2020
jogep pushed a commit to jogep/aws-serverless-java-container that referenced this issue Dec 8, 2020
* fix: Adding pathParameters to v2 proxy event as reported in aws#358.

* fix: Address JSON content type issue reported in aws#352 and aws#344

* fix: Fixed bug caught by integration tests for aws#352

* fix: Fix struts tests for the changes made for aws#352

* test: Attempting to replicate the issue reported in aws#342

* test: Reverting exception test in Spring package since it's only available in Spring5, not Spring4

* fix: Sigh, forgot to remove the import for the class that doesn't exist from the previous commit

* fix: Addresses bug reported in query string parsing (aws#363) for HTTP API support where we have a query string key, followed by a value declarator (=), but then no value

* chore: Update GitHub issue and PR templates

* fix: Fixed issue reported by SpotBugs with the exception logging of the HTTP API query string parsing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants