diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-01-30 16:12:41 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-01-30 16:12:41 +0000 |
| commit | e5c4b24454a37ad6eb5eae3a0685115e4078a06a (patch) | |
| tree | 16138c045553f9c1df8d71a14a62101640b0bf32 /test/HttpRequestTest.cc | |
| parent | 120ea4c609b28c7fd3d907f1fa689737df92b8ef (diff) | |
2009-01-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
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<AuthConfig>().
NetrcAuthResolver::resolveAuthConfig() returns
SharedHandle<AuthConfig>() 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
Diffstat (limited to 'test/HttpRequestTest.cc')
| -rw-r--r-- | test/HttpRequestTest.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/HttpRequestTest.cc b/test/HttpRequestTest.cc index 7b3e11a2..57fe66f4 100644 --- a/test/HttpRequestTest.cc +++ b/test/HttpRequestTest.cc @@ -14,6 +14,7 @@ #include "array_fun.h" #include "CookieStorage.h" #include "Util.h" +#include "AuthConfig.h" namespace aria2 { @@ -224,6 +225,8 @@ void HttpRequestTest::testCreateRequest() _option->put(PREF_HTTP_USER, "aria2user"); _option->put(PREF_HTTP_PASSWD, "aria2passwd"); + CPPUNIT_ASSERT(_authConfigFactory->activateBasicCred("localhost", "/")); + expectedText = "GET /archives/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n" "User-Agent: aria2\r\n" "Accept: */*\r\n" |
