When --http-auth-challenge=true, aria2 only sends basic auth header
when requested. Old implementation sends basic auth header to service
operated in different port in successive request. This change avoid
this bug.
Removed SharedHandle::isNull(). Instead we added operator* and
operator unspecified_bool_type. Removed use of WeakHandle and
replaced with raw pointer.
If user name is embedded but password is missing in URI, first
resolve password using .netrc. If password is found in .netrc,
then use it as password. If not, use the password specified in
--ftp-passwd.
* src/AuthConfigFactory.cc
* src/Request.cc
* src/Request.h
* test/AuthConfigFactoryTest.cc
Added --http-auth-challenge option. If it is set to true(by
default), aria2 sends HTTP authorization header only when it is
requested by the server. If false is set, then authorization
header is always sent to the server. This is useful for servers
that don't respond 401 code when authentication is required.
There is an exception: if username and password are embedded in
URI, authorization header is always sent to the server
regardless of this option.
* src/AuthConfigFactory.cc
* src/HttpSkipResponseCommand.cc
* src/OptionHandlerFactory.cc
* src/prefs.cc
* src/prefs.h
* src/usage_text.h
* test/AuthConfigFactoryTest.cc
* test/HttpRequestTest.cc
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
Use netrc for HTTP.
Now FTP user/password is sent in Authorization header when
--ftp-via-http-proxy=get is given.
* src/AuthConfigFactory.cc
* src/HttpRequest.cc
* src/HttpRequest.h
* src/NetrcAuthResolver.cc
* src/NetrcAuthResolver.h
* src/OptionHandlerFactory.cc
* src/option_processing.cc
* src/prefs.cc
* src/prefs.h
* test/AuthConfigFactoryTest.cc
* test/HttpRequestTest.cc
* test/NetrcAuthResolverTest.cc
Rewritten SharedHandle. Now copy constructor taking raw pointer
has
keyword explicit and SharedHandle's default constructor
initializes
its internal obj to null, old implementation initializes it
using
obj's default constructor.
To assign null, write SharedHandle<T> x(...); x.reset();
TODO: test/SharedHandleTest.cc needs more tests.
* src/SharedHandle.h