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
When the JerseyHandlerFilter handles requests that contain encoded + signs in query parameters it breaks the encoding. As a result, such a query parameter retrieved via @QueryParam in an endpoint is wrongly decoded. As an example, the parameter param=p%2Fz%2B3 of the original request is decoded as param=p/z 3 via the @QueryParam.
Though, the same query parameter that is retrieved as HttpServletRequest#getParameter is properly decoded. The difference is that the serverless contained gets the query parameter directly from the AwsProxyRequest without intermediate decoding/encoding actions.
Expected behavior
Original query parameter param=p%2Fz%2B3 of a request should be retrieved as follows:
Scenario
When the
JerseyHandlerFilter
handles requests that contain encoded+
signs in query parameters it breaks the encoding. As a result, such a query parameter retrieved via@QueryParam
in an endpoint is wrongly decoded. As an example, the parameterparam=p%2Fz%2B3
of the original request is decoded asparam=p/z 3
via the@QueryParam
.Though, the same query parameter that is retrieved as
HttpServletRequest#getParameter
is properly decoded. The difference is that the serverless contained gets the query parameter directly from theAwsProxyRequest
without intermediate decoding/encoding actions.Expected behavior
Original query parameter
param=p%2Fz%2B3
of a request should be retrieved as follows:@QueryParam("param") String param
-> "p/z+3"@QueryParam("param") @Encoded String param
-> "p%2Fz%2B3"request.getParameter("param")
-> "p/z+3"Actual behavior
@QueryParam("param") String param
-> "p/z 3"@QueryParam("param") @Encoded String param
-> "p%2Fz+3"request.getParameter("param")
-> "p/z+3"Steps to reproduce
Create an endpoint
Run the code in AWS Lambda or locally in SAM Local. Then, try to
GET /test?param=p%2Fz%2B3
Full log output
The text was updated successfully, but these errors were encountered: