]> git.kaiwu.me - nginx.git/commitdiff
Removed "Transfer-Encoding: identity" support.
authorMaxim Dounin <mdounin@mdounin.ru>
Thu, 20 Feb 2020 13:19:34 +0000 (16:19 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Thu, 20 Feb 2020 13:19:34 +0000 (16:19 +0300)
The "identity" transfer coding has been removed in RFC 7230.  It is
believed that it is not used in real life, and at the same time it
provides a potential attack vector.

src/http/ngx_http_request.c

index 85c9803787a0820563c2c16afd0721a3778d7f20..9e64fd2934c91a17f670fce9b47c71ffe900c3f7 100644 (file)
@@ -1952,10 +1952,7 @@ ngx_http_process_request_header(ngx_http_request_t *r)
             r->headers_in.content_length_n = -1;
             r->headers_in.chunked = 1;
 
-        } else if (r->headers_in.transfer_encoding->value.len != 8
-            || ngx_strncasecmp(r->headers_in.transfer_encoding->value.data,
-                               (u_char *) "identity", 8) != 0)
-        {
+        } else {
             ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
                           "client sent unknown \"Transfer-Encoding\": \"%V\"",
                           &r->headers_in.transfer_encoding->value);