Skip to content

ArrayIndexOutOfBounds when parsing query string with no value #363

Closed
@sapessi

Description

@sapessi
  • 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)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions