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:
parent
d05d29b507
commit
2568fb95b6
|
@ -180,7 +180,9 @@ int communicate(const std::string& host, uint16_t port,
|
||||||
if(reqvec[0].us.ipv6LiteralAddress) {
|
if(reqvec[0].us.ipv6LiteralAddress) {
|
||||||
ss << "]";
|
ss << "]";
|
||||||
}
|
}
|
||||||
|
if(port != 443) {
|
||||||
ss << ":" << port;
|
ss << ":" << port;
|
||||||
|
}
|
||||||
std::string hostport = ss.str();
|
std::string hostport = ss.str();
|
||||||
|
|
||||||
for(int i = 0, n = reqvec.size(); i < n; ++i) {
|
for(int i = 0, n = reqvec.size(); i < n; ++i) {
|
||||||
|
|
|
@ -116,7 +116,8 @@ int Spdylay::submit_request(const std::string& hostport,
|
||||||
":version", "HTTP/1.1",
|
":version", "HTTP/1.1",
|
||||||
":scheme", "https",
|
":scheme", "https",
|
||||||
":host", hostport.c_str(),
|
":host", hostport.c_str(),
|
||||||
"user-agent", "spdylay/0.0.0",
|
"accept", "*/*",
|
||||||
|
"user-agent", "spdylay/"SPDYLAY_VERSION,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
return spdylay_submit_request(session_, pri, nv, NULL, stream_user_data);
|
return spdylay_submit_request(session_, pri, nv, NULL, stream_user_data);
|
||||||
|
|
Loading…
Reference in New Issue