forked from mirrors/kore
Do not send connection:close for websocket upgrades.
This commit is contained in:
parent
a4e462b36c
commit
be3fa17201
17
src/http.c
17
src/http.c
|
@ -1247,15 +1247,16 @@ http_response_normal(struct http_request *req, struct connection *c,
|
|||
}
|
||||
}
|
||||
|
||||
if (http_keepalive_time && connection_close == 0) {
|
||||
if (req->owner->proto != CONN_PROTO_WEBSOCKET) {
|
||||
kore_buf_appendf(header_buf, "connection: keep-alive\r\n");
|
||||
kore_buf_appendf(header_buf, "keep-alive: timeout=%d\r\n",
|
||||
http_keepalive_time);
|
||||
if (req->owner->proto != CONN_PROTO_WEBSOCKET) {
|
||||
if (http_keepalive_time && connection_close == 0) {
|
||||
kore_buf_appendf(header_buf,
|
||||
"connection: keep-alive\r\n");
|
||||
kore_buf_appendf(header_buf,
|
||||
"keep-alive: timeout=%d\r\n", http_keepalive_time);
|
||||
} else {
|
||||
c->flags |= CONN_CLOSE_EMPTY;
|
||||
kore_buf_appendf(header_buf, "connection: close\r\n");
|
||||
}
|
||||
} else {
|
||||
c->flags |= CONN_CLOSE_EMPTY;
|
||||
kore_buf_appendf(header_buf, "connection: close\r\n");
|
||||
}
|
||||
|
||||
if (http_hsts_enable) {
|
||||
|
|
Loading…
Reference in New Issue