comparison src/http/v3/ngx_http_v3_request.c @ 8616:7416d3b2fac5 quic

HTTP/3: added CONNECT and TRACE methods rejection. It has got lost in e1eb7f4ca9f1, let alone a subsequent update in 63c66b7cc07c.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 16 Sep 2021 13:13:22 +0300
parents e29c1ede905f
children 33578b8d453d
comparison
equal deleted inserted replaced
8615:7603284f7af5 8616:7416d3b2fac5
43 { ngx_string("MOVE"), NGX_HTTP_MOVE }, 43 { ngx_string("MOVE"), NGX_HTTP_MOVE },
44 { ngx_string("PROPPATCH"), NGX_HTTP_PROPPATCH }, 44 { ngx_string("PROPPATCH"), NGX_HTTP_PROPPATCH },
45 { ngx_string("LOCK"), NGX_HTTP_LOCK }, 45 { ngx_string("LOCK"), NGX_HTTP_LOCK },
46 { ngx_string("UNLOCK"), NGX_HTTP_UNLOCK }, 46 { ngx_string("UNLOCK"), NGX_HTTP_UNLOCK },
47 { ngx_string("PATCH"), NGX_HTTP_PATCH }, 47 { ngx_string("PATCH"), NGX_HTTP_PATCH },
48 { ngx_string("TRACE"), NGX_HTTP_TRACE } 48 { ngx_string("TRACE"), NGX_HTTP_TRACE },
49 { ngx_string("CONNECT"), NGX_HTTP_CONNECT }
49 }; 50 };
50 51
51 52
52 void 53 void
53 ngx_http_v3_init(ngx_connection_t *c) 54 ngx_http_v3_init(ngx_connection_t *c)
776 } 777 }
777 778
778 if (n != 0) { 779 if (n != 0) {
779 r->headers_in.chunked = 1; 780 r->headers_in.chunked = 1;
780 } 781 }
782 }
783
784 if (r->method == NGX_HTTP_CONNECT) {
785 ngx_log_error(NGX_LOG_INFO, c->log, 0, "client sent CONNECT method");
786 ngx_http_finalize_request(r, NGX_HTTP_NOT_ALLOWED);
787 return NGX_ERROR;
788 }
789
790 if (r->method == NGX_HTTP_TRACE) {
791 ngx_log_error(NGX_LOG_INFO, c->log, 0, "client sent TRACE method");
792 ngx_http_finalize_request(r, NGX_HTTP_NOT_ALLOWED);
793 return NGX_ERROR;
781 } 794 }
782 795
783 return NGX_OK; 796 return NGX_OK;
784 797
785 failed: 798 failed: