mirror of https://github.com/aria2/aria2
In http request, suppress port number in http request header if
port is 80 or 443: * src/HttpRequest.cc (getHostText): Suppress port number in http request header if port is 80 or 443. (createProxyRequest): Allways send port number.pull/1/head
parent
fe9c638735
commit
4016aa3948
|
@ -15,7 +15,13 @@
|
||||||
* src/DNSCache.h: New class.
|
* src/DNSCache.h: New class.
|
||||||
* src/UrlRequestInfo.cc
|
* src/UrlRequestInfo.cc
|
||||||
(execute): Use dns cache.
|
(execute): Use dns cache.
|
||||||
|
|
||||||
|
In http request, suppress port number in http request header if port
|
||||||
|
is 80 or 443:
|
||||||
|
* src/HttpRequest.cc (getHostText): Suppress port number in http
|
||||||
|
request header if port is 80 or 443.
|
||||||
|
(createProxyRequest): Allways send port number.
|
||||||
|
|
||||||
2007-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2007-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
To add the command-line option which disables netrc support:
|
To add the command-line option which disables netrc support:
|
||||||
|
|
|
@ -65,7 +65,7 @@ bool HttpRequest::isRangeSatisfied(const RangeHandle& range) const
|
||||||
|
|
||||||
string HttpRequest::getHostText(const string& host, in_port_t port) const
|
string HttpRequest::getHostText(const string& host, in_port_t port) const
|
||||||
{
|
{
|
||||||
return host+":"+Util::itos(port);
|
return host+(port == 80 || port == 443 ? "" : ":"+Util::llitos(port));
|
||||||
}
|
}
|
||||||
|
|
||||||
string HttpRequest::createRequest() const
|
string HttpRequest::createRequest() const
|
||||||
|
@ -131,11 +131,11 @@ string HttpRequest::createRequest() const
|
||||||
string HttpRequest::createProxyRequest() const
|
string HttpRequest::createProxyRequest() const
|
||||||
{
|
{
|
||||||
string requestLine =
|
string requestLine =
|
||||||
string("CONNECT ")+getHost()+":"+Util::llitos(getPort())+
|
string("CONNECT ")+getHost()+":"+Util::itos(getPort())+
|
||||||
string(" HTTP/1.1\r\n")+
|
string(" HTTP/1.1\r\n")+
|
||||||
"User-Agent: "+Util::urlencode(userAgent)+"\r\n"+
|
"User-Agent: "+Util::urlencode(userAgent)+"\r\n"+
|
||||||
"Proxy-Connection: close\r\n"+
|
"Proxy-Connection: close\r\n"+
|
||||||
"Host: "+getHostText(getHost(), getPort())+"\r\n";
|
"Host: "+getHost()+":"+Util::itos(getPort())+"\r\n";
|
||||||
if(proxyAuthEnabled) {
|
if(proxyAuthEnabled) {
|
||||||
requestLine += getProxyAuthString();
|
requestLine += getProxyAuthString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue