diff src/http/ngx_http_parse.c @ 256:2e9c57a5e50a NGINX_0_4_13

nginx 0.4.13 *) Feature: the "proxy_pass" directive may be used inside the "limit_except" block. *) Feature: the "limit_except" directive supports all WebDAV methods. *) Bugfix: if the "add_before_body" directive was used without the "add_after_body" directive, then an response did not transferred complete. *) Bugfix: a large request body did not receive if the epoll method and the deferred accept() were used. *) Bugfix: a charset could not be set for ngx_http_autoindex_module responses; bug appeared in 0.3.50. *) Bugfix: the "[alert] zero size buf" error when FastCGI server was used; *) Bugfix: the --group= configuration parameter was ignored. Thanks to Thomas Moschny. *) Bugfix: the 50th subrequest in SSI response did not work; bug appeared in 0.3.50.
author Igor Sysoev <http://sysoev.ru>
date Wed, 15 Nov 2006 00:00:00 +0300
parents f3ec44f4a53b
children 6ae1357b7b7c
line wrap: on
line diff
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -94,23 +94,49 @@ ngx_http_parse_request_line(ngx_http_req
                 case 3:
                     if (m[0] == 'G' && m[1] == 'E' && m[2] == 'T') {
                         r->method = NGX_HTTP_GET;
+                        break;
+                    }
 
-                    } else if (m[0] == 'P' && m[1] == 'U' && m[2] == 'T') {
+                    if (m[0] == 'P' && m[1] == 'U' && m[2] == 'T') {
                         r->method = NGX_HTTP_PUT;
+                        break;
                     }
+
                     break;
 
                 case 4:
-                    if (m[0] == 'P' && m[1] == 'O'
-                        && m[2] == 'S' && m[3] == 'T')
-                    {
-                        r->method = NGX_HTTP_POST;
+                    if (m[1] == 'O') {
+
+                        if (m[0] == 'P' && m[2] == 'S' && m[3] == 'T') {
+                            r->method = NGX_HTTP_POST;
+                            break;
+                        }
+
+                        if (m[0] == 'C' && m[2] == 'P' && m[3] == 'Y') {
+                            r->method = NGX_HTTP_COPY;
+                            break;
+                        }
 
-                    } else if (m[0] == 'H' && m[1] == 'E'
-                               && m[2] == 'A' && m[3] == 'D')
-                    {
-                        r->method = NGX_HTTP_HEAD;
+                        if (m[0] == 'M' && m[2] == 'V' && m[3] == 'E') {
+                            r->method = NGX_HTTP_MOVE;
+                            break;
+                        }
+
+                        if (m[0] == 'L' && m[2] == 'C' && m[3] == 'K') {
+                            r->method = NGX_HTTP_LOCK;
+                            break;
+                        }
+
+                    } else {
+
+                        if (m[0] == 'H' && m[1] == 'E'
+                            && m[2] == 'A' && m[3] == 'D')
+                        {
+                            r->method = NGX_HTTP_HEAD;
+                            break;
+                        }
                     }
+
                     break;
 
                 case 5:
@@ -119,6 +145,7 @@ ngx_http_parse_request_line(ngx_http_req
                     {
                         r->method = NGX_HTTP_MKCOL;
                     }
+
                     break;
 
                 case 6:
@@ -126,7 +153,46 @@ ngx_http_parse_request_line(ngx_http_req
                         && m[3] == 'E' && m[4] == 'T' && m[5] == 'E')
                     {
                         r->method = NGX_HTTP_DELETE;
+                        break;
                     }
+
+                    if (m[0] == 'U' && m[1] == 'N' && m[2] == 'L'
+                        && m[3] == 'O' && m[4] == 'C' && m[5] == 'K')
+                    {
+                        r->method = NGX_HTTP_UNLOCK;
+                        break;
+                    }
+
+                    break;
+
+                case 7:
+                    if (m[0] == 'O' && m[1] == 'P'
+                        && m[2] == 'T' && m[3] == 'I'
+                        && m[4] == 'O' && m[5] == 'N' && m[6] == 'S')
+                    {
+                        r->method = NGX_HTTP_OPTIONS;
+                    }
+
+                    break;
+
+                case 8:
+                    if (m[0] == 'P' && m[1] == 'R'
+                        && m[2] == 'O' && m[3] == 'P' && m[4] == 'F'
+                        && m[5] == 'I' && m[6] == 'N' && m[7] == 'D')
+                    {
+                        r->method = NGX_HTTP_PROPFIND;
+                    }
+
+                    break;
+
+                case 9:
+                    if (m[0] == 'P' && m[1] == 'R' && m[2] == 'O'
+                        && m[3] == 'P' && m[4] == 'P' && m[5] == 'A'
+                        && m[6] == 'T' && m[7] == 'C' && m[8] == 'H')
+                    {
+                        r->method = NGX_HTTP_PROPPATCH;
+                    }
+
                     break;
                 }