diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-09-25 14:48:38 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-09-25 14:48:38 +0000 |
| commit | 789e1926cb5f07ce5a82c8d651dbd5a510759c8d (patch) | |
| tree | 66ad59cd7be9c87fcab59c3eac5a43a4baa129dd /src/Request.cc | |
| parent | 92d702fa5349c722c6b59256bafe552c8b5cd8a1 (diff) | |
2008-09-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Now colon is required for username and password in FTP URL,
like:
ftp://username:password@host.
If colon is not there, aria2 don't parse it as a username. For
example,
aria2 don't retrieve username from ftp://username@host.
This fix was made in order to login FTP server via
non-transparent ftp
proxy.
* src/Request.cc
* test/RequestTest.cc
Diffstat (limited to 'src/Request.cc')
| -rw-r--r-- | src/Request.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Request.cc b/src/Request.cc index 4daf4aaf..f3cba967 100644 --- a/src/Request.cc +++ b/src/Request.cc @@ -136,10 +136,12 @@ bool Request::parseUrl(const std::string& url) { std::string::size_type atmarkp = hostPart.find_last_of("@"); if(atmarkp != std::string::npos) { std::string authPart = hostPart.substr(0, atmarkp); - std::pair<std::string, std::string> userPass = - Util::split(authPart, A2STR::COLON_C); - _username = Util::urldecode(userPass.first); - _password = Util::urldecode(userPass.second); + if(authPart.find(":") != std::string::npos) { + std::pair<std::string, std::string> userPass = + Util::split(authPart, A2STR::COLON_C); + _username = Util::urldecode(userPass.first); + _password = Util::urldecode(userPass.second); + } hostPart.erase(0, atmarkp+1); } std::pair<std::string, std::string> hostAndPort; |
