Issue #1642 - avoid casting to get to (base) Request
This commit is contained in:
parent
b0e5681451
commit
3aa42d989b
|
@ -181,24 +181,27 @@ public class RuleContainer extends Rule
|
||||||
request.setAttribute(_originalQueryStringAttribute,query);
|
request.setAttribute(_originalQueryStringAttribute,query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ugly hack, we should just pass baseRequest into the API from RewriteHandler itself.
|
||||||
|
Request baseRequest = Request.getBaseRequest(request);
|
||||||
|
|
||||||
if (_rewriteRequestURI)
|
if (_rewriteRequestURI)
|
||||||
{
|
{
|
||||||
String encoded=URIUtil.encodePath(applied);
|
String encoded=URIUtil.encodePath(applied);
|
||||||
if (rule instanceof Rule.ApplyURI)
|
if (rule instanceof Rule.ApplyURI)
|
||||||
((Rule.ApplyURI)rule).applyURI((Request)request,((Request)request).getRequestURI(), encoded);
|
((Rule.ApplyURI)rule).applyURI(baseRequest, baseRequest.getRequestURI(), encoded);
|
||||||
else
|
else
|
||||||
((Request)request).setURIPathQuery(encoded);
|
baseRequest.setURIPathQuery(encoded);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_rewritePathInfo)
|
if (_rewritePathInfo)
|
||||||
((Request)request).setPathInfo(applied);
|
baseRequest.setPathInfo(applied);
|
||||||
|
|
||||||
target=applied;
|
target=applied;
|
||||||
|
|
||||||
if (rule.isHandling())
|
if (rule.isHandling())
|
||||||
{
|
{
|
||||||
LOG.debug("handling {}",rule);
|
LOG.debug("handling {}",rule);
|
||||||
Request.getBaseRequest(request).setHandled(true);
|
baseRequest.setHandled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rule.isTerminating())
|
if (rule.isTerminating())
|
||||||
|
|
Loading…
Reference in New Issue