]> git.kaiwu.me - nginx.git/commitdiff
Perl: fixed $r->header_in("Connection").
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 30 May 2022 18:25:25 +0000 (21:25 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 30 May 2022 18:25:25 +0000 (21:25 +0300)
Previously, the r->header_in->connection pointer was never set despite
being present in ngx_http_headers_in, resulting in incorrect value returned
by $r->header_in("Connection") in embedded perl.

src/http/ngx_http_request.c

index 013b7158e23b68bc8a13fe734da8ac5a5bb6718e..44e4d89dec1be162de39b56855f08d49b3ece627 100644 (file)
@@ -1827,6 +1827,10 @@ static ngx_int_t
 ngx_http_process_connection(ngx_http_request_t *r, ngx_table_elt_t *h,
     ngx_uint_t offset)
 {
+    if (ngx_http_process_header_line(r, h, offset) != NGX_OK) {
+        return NGX_ERROR;
+    }
+
     if (ngx_strcasestrn(h->value.data, "close", 5 - 1)) {
         r->headers_in.connection_type = NGX_HTTP_CONNECTION_CLOSE;