From 694cd07f1dec01a75c3f987d0609ecdf4119e9c4 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 15 May 2014 23:45:17 +0900 Subject: [PATCH] nghttpx: Remove Connection: close header field from CONNECT response It appears that some Android client does not like Connection: close in 200 CONNECT response. Browsers fine with this header field. It is better to remove it. Squid does not emit it too. --- src/shrpx_https_upstream.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shrpx_https_upstream.cc b/src/shrpx_https_upstream.cc index 13c09cc5..028bf19d 100644 --- a/src/shrpx_https_upstream.cc +++ b/src/shrpx_https_upstream.cc @@ -676,7 +676,8 @@ int HttpsUpstream::on_downstream_header_complete(Downstream *downstream) // We add this header for HTTP/1.0 or HTTP/0.9 clients hdrs += "Connection: Keep-Alive\r\n"; } - } else { + } else if(!downstream->get_upgraded() || + downstream->get_request_method() != "CONNECT") { hdrs += "Connection: close\r\n"; }