[core] do not send Connection: close if h2
This commit is contained in:
parent
21987c863f
commit
e089facf84
|
@ -75,7 +75,8 @@ int http_response_write_header(request_st * const r) {
|
|||
if ((r->resp_htags & HTTP_HEADER_UPGRADE) && r->http_version == HTTP_VERSION_1_1) {
|
||||
http_header_response_set(r, HTTP_HEADER_CONNECTION, CONST_STR_LEN("Connection"), CONST_STR_LEN("upgrade"));
|
||||
} else if (0 == r->keep_alive) {
|
||||
http_header_response_set(r, HTTP_HEADER_CONNECTION, CONST_STR_LEN("Connection"), CONST_STR_LEN("close"));
|
||||
if (r->http_version <= HTTP_VERSION_1_1) /*(e.g. not HTTP_VERSION_2)*/
|
||||
http_header_response_set(r, HTTP_HEADER_CONNECTION, CONST_STR_LEN("Connection"), CONST_STR_LEN("close"));
|
||||
} else if (r->http_version == HTTP_VERSION_1_0) {/*(&& r->keep_alive != 0)*/
|
||||
http_header_response_set(r, HTTP_HEADER_CONNECTION, CONST_STR_LEN("Connection"), CONST_STR_LEN("keep-alive"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue