]> git.kaiwu.me - nginx.git/commitdiff
Allowed '-' in method names.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 10 Oct 2016 13:24:50 +0000 (16:24 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 10 Oct 2016 13:24:50 +0000 (16:24 +0300)
It is used at least by SOAP (M-POST method, defined by RFC 2774) and
by WebDAV versioning (VERSION-CONTROL and BASELINE-CONTROL methods,
defined by RFC 3253).

src/http/ngx_http_parse.c
src/http/v2/ngx_http_v2.c

index bd6c9c9b5de6c32d2b9055120aa0e1bd4c1efd05..9f994731611af9bb10cfc52b0a30b39e2ece4dfc 100644 (file)
@@ -149,7 +149,7 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
                 break;
             }
 
-            if ((ch < 'A' || ch > 'Z') && ch != '_') {
+            if ((ch < 'A' || ch > 'Z') && ch != '_' && ch != '-') {
                 return NGX_HTTP_PARSE_INVALID_METHOD;
             }
 
@@ -270,7 +270,7 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
                 break;
             }
 
-            if ((ch < 'A' || ch > 'Z') && ch != '_') {
+            if ((ch < 'A' || ch > 'Z') && ch != '_' && ch != '-') {
                 return NGX_HTTP_PARSE_INVALID_METHOD;
             }
 
index d0cd2ab791fb43b5c3acf970436f647a2a21c3ec..235092b21f47bb4e049eab3ef31f5cbe8517962b 100644 (file)
@@ -3178,7 +3178,7 @@ ngx_http_v2_parse_method(ngx_http_request_t *r, ngx_http_v2_header_t *header)
     p = r->method_name.data;
 
     do {
-        if ((*p < 'A' || *p > 'Z') && *p != '_') {
+        if ((*p < 'A' || *p > 'Z') && *p != '_' && *p != '-') {
             ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
                           "client sent invalid method: \"%V\"",
                           &r->method_name);