spdycat: Don't include port in host header field if port == 443.

Added accept header field.
Use SPDYLAY_VERSION in user-agent header field.

Some sites do not like 443 is in host header field.
This commit is contained in:
Tatsuhiro Tsujikawa 2012-03-09 02:36:55 +09:00
parent d05d29b507
commit 2568fb95b6
2 changed files with 5 additions and 2 deletions

View File

@ -180,7 +180,9 @@ int communicate(const std::string& host, uint16_t port,
if(reqvec[0].us.ipv6LiteralAddress) {
ss << "]";
}
ss << ":" << port;
if(port != 443) {
ss << ":" << port;
}
std::string hostport = ss.str();
for(int i = 0, n = reqvec.size(); i < n; ++i) {

View File

@ -116,7 +116,8 @@ int Spdylay::submit_request(const std::string& hostport,
":version", "HTTP/1.1",
":scheme", "https",
":host", hostport.c_str(),
"user-agent", "spdylay/0.0.0",
"accept", "*/*",
"user-agent", "spdylay/"SPDYLAY_VERSION,
NULL
};
return spdylay_submit_request(session_, pri, nv, NULL, stream_user_data);