Merge pull request #4145 from eclipse/jetty-9.4.x-4144-naked-request-cast

Fixing #4144 - handle wrapped requests better
This commit is contained in:
Joakim Erdfelt 2019-10-01 19:06:07 -05:00 committed by GitHub
commit bb939f6f71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -46,7 +46,8 @@ public class ForwardedSchemeHeaderRule extends HeaderRule
@Override
protected String apply(String target, String value, HttpServletRequest request, HttpServletResponse response)
{
((Request)request).setScheme(_scheme);
Request baseRequest = Request.getBaseRequest(request);
baseRequest.setScheme(_scheme);
return target;
}
}

View File

@ -121,6 +121,8 @@ public class DigestAuthenticator extends LoginAuthenticator
try
{
Request baseRequest = Request.getBaseRequest(request);
boolean stale = false;
if (credentials != null)
{
@ -173,7 +175,7 @@ public class DigestAuthenticator extends LoginAuthenticator
}
}
int n = checkNonce(digest, (Request)request);
int n = checkNonce(digest, baseRequest);
if (n > 0)
{
@ -195,7 +197,7 @@ public class DigestAuthenticator extends LoginAuthenticator
domain = "/";
response.setHeader(HttpHeader.WWW_AUTHENTICATE.asString(), "Digest realm=\"" + _loginService.getName() +
"\", domain=\"" + domain +
"\", nonce=\"" + newNonce((Request)request) +
"\", nonce=\"" + newNonce(baseRequest) +
"\", algorithm=MD5" +
", qop=\"auth\"" +
", stale=" + stale);