RFC 7231: do not generate header fields in TRACE requests containing sensitive data such as cookie and user credentials
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1686590 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6d72c0e326
commit
12a8eaabab
|
@ -79,7 +79,7 @@ public class RequestAddCookies implements HttpRequestInterceptor {
|
|||
Args.notNull(context, "HTTP context");
|
||||
|
||||
final String method = request.getRequestLine().getMethod();
|
||||
if (method.equalsIgnoreCase("CONNECT")) {
|
||||
if (method.equalsIgnoreCase("CONNECT") || method.equalsIgnoreCase("TRACE")) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -277,6 +277,11 @@ public class MainClientExec implements ClientExecChain {
|
|||
connHolder.markNonReusable();
|
||||
}
|
||||
|
||||
if (request.getMethod().equalsIgnoreCase("TRACE")) {
|
||||
// Do not perform authentication for TRACE request
|
||||
break;
|
||||
}
|
||||
|
||||
if (needAuthentication(
|
||||
targetAuthState, proxyAuthState, route, response, context)) {
|
||||
// Make sure the response body is fully consumed, if present
|
||||
|
|
Loading…
Reference in New Issue