From 2568fb95b6051af915081bf7140f0748f2333b87 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 9 Mar 2012 02:36:55 +0900 Subject: [PATCH] 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. --- examples/spdycat.cc | 4 +++- examples/spdylay_ssl.cc | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/spdycat.cc b/examples/spdycat.cc index ea7e13d0..c0d29d27 100644 --- a/examples/spdycat.cc +++ b/examples/spdycat.cc @@ -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) { diff --git a/examples/spdylay_ssl.cc b/examples/spdylay_ssl.cc index a8dce472..64f50c1a 100644 --- a/examples/spdylay_ssl.cc +++ b/examples/spdylay_ssl.cc @@ -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);