From e5c4b24454a37ad6eb5eae3a0685115e4078a06a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 30 Jan 2009 16:12:41 +0000 Subject: 2009-01-31 Tatsuhiro Tsujikawa Send HTTP Authorization header only if it is requested by the server(response 401). There are some exceptions. The authorization header for proxy is always sent if it is available without request by the server. If username/password is specified in the URI, it is immediately sent to the server without request by the server. AbstractAuthResolver::_defaultAuthConfig is now initialized as SharedHandle(). NetrcAuthResolver::resolveAuthConfig() returns SharedHandle() if no AuthConfig is available. * src/AbstractAuthResolver.cc * src/AbstractProxyRequestCommand.cc * src/AuthConfigFactory.cc * src/AuthConfigFactory.h * src/HttpConnection.cc * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * test/AuthConfigFactoryTest.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc --- src/AbstractProxyRequestCommand.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/AbstractProxyRequestCommand.cc') diff --git a/src/AbstractProxyRequestCommand.cc b/src/AbstractProxyRequestCommand.cc index ce495f23..d7cfb51d 100644 --- a/src/AbstractProxyRequestCommand.cc +++ b/src/AbstractProxyRequestCommand.cc @@ -44,6 +44,7 @@ #include "Socket.h" #include "CookieStorage.h" #include "AuthConfigFactory.h" +#include "AuthConfig.h" namespace aria2 { @@ -72,7 +73,6 @@ bool AbstractProxyRequestCommand::executeInternal() { HttpRequestHandle httpRequest(new HttpRequest()); httpRequest->setUserAgent(e->option->get(PREF_USER_AGENT)); httpRequest->setRequest(req); - httpRequest->setAuthConfigFactory(e->getAuthConfigFactory()); httpRequest->setProxyRequest(_proxyRequest); httpConnection->sendProxyRequest(httpRequest); -- cgit