summaryrefslogtreecommitdiff
path: root/src/HttpRequest.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-08-30 15:05:30 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-08-30 15:05:30 +0000
commitce25b54cfe3ba23408da19fcd87539bec879b943 (patch)
treeb60b7edf6f808aee791b72ecdc64131d3d36665d /src/HttpRequest.cc
parent19ae8f9d07ba6a8f1d3b6f501a01f9285b6875e9 (diff)
2009-08-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added support for IPv6 literal address in URI. Now aria2 can handle URI such as http://[::1]/ * src/HttpRequest.cc * src/HttpRequest.h * src/Request.cc * src/Request.h * test/HttpRequestTest.cc * test/OptionHandlerTest.cc * test/RequestTest.cc
Diffstat (limited to 'src/HttpRequest.cc')
-rw-r--r--src/HttpRequest.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc
index 3c4e8f06..63bdc557 100644
--- a/src/HttpRequest.cc
+++ b/src/HttpRequest.cc
@@ -117,7 +117,7 @@ bool HttpRequest::isRangeSatisfied(const RangeHandle& range) const
}
}
-std::string HttpRequest::getHostText(const std::string& host, uint16_t port) const
+static std::string getHostText(const std::string& host, uint16_t port)
{
std::string hosttext = host;
if(!(port == 80 || port == 443)) {
@@ -172,7 +172,7 @@ std::string HttpRequest::createRequest()
}
}
- strappend(requestLine, "Host: ", getHostText(getHost(), getPort()), "\r\n");
+ strappend(requestLine, "Host: ", getHostText(getURIHost(), getPort()), "\r\n");
requestLine += "Pragma: no-cache\r\n";
requestLine += "Cache-Control: no-cache\r\n";
@@ -235,7 +235,7 @@ std::string HttpRequest::createRequest()
std::string HttpRequest::createProxyRequest() const
{
assert(!_proxyRequest.isNull());
- std::string hostport = getHost();
+ std::string hostport = getURIHost();
strappend(hostport, ":", Util::uitos(getPort()));
std::string requestLine = "CONNECT ";