-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
1.4.26.Final, 2.0.15.Final
-
None
We have a ServletFilter that uses ServletFilter.startAsync() to create a AsyncContext
that it later do context.dispatch() on from another thread.
We problem is that the requestPath and relativePath in the request becomes url encoded inside AsyncContextImpl.dispatch()
The following is a represenatation of relevant parts of the HttpServletRequestImpl object before the filter runs ac = request.startAsync(); and after ac.dispatch();
HttpServletRequestImpl ( Before startAsync(), request.getDispatcherType() == DispatcherType.REQUEST ) @13239
characterEncoding: UTF-8
queryParameters: (null)
exchange (HttpServerExchange) @13244
queryParameters:
key: q
value: a=a
requestURI: /staterepository/pm_vrRequest%3ASCAR-000102
requestPath: /staterepository/pm_vrRequest:SCAR-000102
relativePath: /staterepository/pm_vrRequest:SCAR-000102
queryString: q=a%3Da
HttpServletRequestImpl ( After startAsync() and after dispatch(), request.getDispatcherType() == DispatcherType.ASYNC ) @13239
characterEncoding: UTF-8
queryParameters:
key: q
value: a%3Da
exchange (HttpServerExchange) @13244
queryParameters: (null)
requestURI: /staterepository/pm_vrRequest%3ASCAR-000102
requestPath: /staterepository/pm_vrRequest%3ASCAR-000102
relativePath: /staterepository/pm_vrRequest%3ASCAR-000102
queryString: q=a%3Da
The @number is an object reference
There is couple of differences after AsyncContextImpl.dispatch() has run
1, requestPath and relativePath has become urlencoded
2, queryParameters in the request object has been set and the value is urlencoded
3, queryParameters in the exchange object has been reset to null.
AsyncContextImpl needs to do what HttpRequestParser does, parse the path and decode it
if UndertowOptions.DECODE_URL is set to true before it extract the different parts from the new path (that is either provided in argument to AsyncContext.dispatch(String) or AsyncContext.dispatch(ServletContext, String) or extracted from AsyncContext.dispatch()
AsyncContext.dispatch() calls AsyncContext.dispatch(ServletContext, String path)
where path is created from requestURI and queryString, they are both urlencoded.
- duplicates
-
UNDERTOW-1591 HttpServletRequestImpl#getServletPath() and getPathInfo() returns non-decoded value after AsyncContextImpl#dispatch()
- Resolved