Fixing #4144 - handle wrapped requests better
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
parent
6fc42d8ba2
commit
e9ac2c8c97
|
@ -46,7 +46,8 @@ public class ForwardedSchemeHeaderRule extends HeaderRule
|
||||||
@Override
|
@Override
|
||||||
protected String apply(String target, String value, HttpServletRequest request, HttpServletResponse response)
|
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;
|
return target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,6 +121,8 @@ public class DigestAuthenticator extends LoginAuthenticator
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Request baseRequest = Request.getBaseRequest(request);
|
||||||
|
|
||||||
boolean stale = false;
|
boolean stale = false;
|
||||||
if (credentials != null)
|
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)
|
if (n > 0)
|
||||||
{
|
{
|
||||||
|
@ -195,7 +197,7 @@ public class DigestAuthenticator extends LoginAuthenticator
|
||||||
domain = "/";
|
domain = "/";
|
||||||
response.setHeader(HttpHeader.WWW_AUTHENTICATE.asString(), "Digest realm=\"" + _loginService.getName() +
|
response.setHeader(HttpHeader.WWW_AUTHENTICATE.asString(), "Digest realm=\"" + _loginService.getName() +
|
||||||
"\", domain=\"" + domain +
|
"\", domain=\"" + domain +
|
||||||
"\", nonce=\"" + newNonce((Request)request) +
|
"\", nonce=\"" + newNonce(baseRequest) +
|
||||||
"\", algorithm=MD5" +
|
"\", algorithm=MD5" +
|
||||||
", qop=\"auth\"" +
|
", qop=\"auth\"" +
|
||||||
", stale=" + stale);
|
", stale=" + stale);
|
||||||
|
|
Loading…
Reference in New Issue