<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2015-11-24 22:41 GMT+02:00 Ruslan Ermilov <span dir="ltr"><<a href="mailto:ru@nginx.com" target="_blank">ru@nginx.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">details:   <a href="http://hg.nginx.org/nginx/rev/b1858fc47e3b" rel="noreferrer" target="_blank">http://hg.nginx.org/nginx/rev/b1858fc47e3b</a><br>
branches:<br>
changeset: 6306:b1858fc47e3b<br>
user:      Ruslan Ermilov <<a href="mailto:ru@nginx.com" target="_blank">ru@nginx.com</a>><br>
date:      Fri Nov 06 15:22:43 2015 +0300<br>
description:<br>
Style: unified request method checks.<br>
<br>
diffstat:<br>
<br>
 src/http/modules/ngx_http_chunked_filter_module.c |  2 +-<br>
 src/http/modules/ngx_http_static_module.c         |  2 +-<br>
 src/http/modules/ngx_http_stub_status_module.c    |  2 +-<br>
 src/http/ngx_http_request.c                       |  2 +-<br>
 src/http/ngx_http_upstream.c                      |  2 +-<br>
 5 files changed, 5 insertions(+), 5 deletions(-)<br>
<br>
diffs (60 lines):<br>
<br>
diff -r 18428f775b2c -r b1858fc47e3b src/http/modules/ngx_http_chunked_filter_module.c<br>
--- a/src/http/modules/ngx_http_chunked_filter_module.c Mon Nov 23 12:40:19 2015 +0300<br>
+++ b/src/http/modules/ngx_http_chunked_filter_module.c Fri Nov 06 15:22:43 2015 +0300<br>
@@ -64,7 +64,7 @@ ngx_http_chunked_header_filter(ngx_http_<br>
         || r->headers_out.status == NGX_HTTP_NO_CONTENT<br>
         || r->headers_out.status < NGX_HTTP_OK<br>
         || r != r->main<br>
-        || (r->method & NGX_HTTP_HEAD))<br>
+        || r->method == NGX_HTTP_HEAD)<br>
     {<br>
         return ngx_http_next_header_filter(r);<br>
     }<br>
diff -r 18428f775b2c -r b1858fc47e3b src/http/modules/ngx_http_static_module.c<br>
--- a/src/http/modules/ngx_http_static_module.c Mon Nov 23 12:40:19 2015 +0300<br>
+++ b/src/http/modules/ngx_http_static_module.c Fri Nov 06 15:22:43 2015 +0300<br>
@@ -204,7 +204,7 @@ ngx_http_static_handler(ngx_http_request<br>
<br>
 #endif<br>
<br>
-    if (r->method & NGX_HTTP_POST) {<br>
+    if (r->method == NGX_HTTP_POST) {<br>
         return NGX_HTTP_NOT_ALLOWED;<br>
     }<br>
<br>
diff -r 18428f775b2c -r b1858fc47e3b src/http/modules/ngx_http_stub_status_module.c<br>
--- a/src/http/modules/ngx_http_stub_status_module.c    Mon Nov 23 12:40:19 2015 +0300<br>
+++ b/src/http/modules/ngx_http_stub_status_module.c    Fri Nov 06 15:22:43 2015 +0300<br>
@@ -89,7 +89,7 @@ ngx_http_stub_status_handler(ngx_http_re<br>
     ngx_chain_t        out;<br>
     ngx_atomic_int_t   ap, hn, ac, rq, rd, wr, wa;<br>
<br>
-    if (r->method != NGX_HTTP_GET && r->method != NGX_HTTP_HEAD) {<br>
+    if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {<br></blockquote><div>Since it's about the style, not really an unification I would say. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
         return NGX_HTTP_NOT_ALLOWED;<br>
     }<br>
<br>
diff -r 18428f775b2c -r b1858fc47e3b src/http/ngx_http_request.c<br>
--- a/src/http/ngx_http_request.c       Mon Nov 23 12:40:19 2015 +0300<br>
+++ b/src/http/ngx_http_request.c       Fri Nov 06 15:22:43 2015 +0300<br>
@@ -1788,7 +1788,7 @@ ngx_http_process_request_header(ngx_http<br>
         }<br>
     }<br>
<br>
-    if (r->method & NGX_HTTP_TRACE) {<br>
+    if (r->method == NGX_HTTP_TRACE) {<br>
         ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,<br>
                       "client sent TRACE method");<br>
         ngx_http_finalize_request(r, NGX_HTTP_NOT_ALLOWED);<br>
diff -r 18428f775b2c -r b1858fc47e3b src/http/ngx_http_upstream.c<br>
--- a/src/http/ngx_http_upstream.c      Mon Nov 23 12:40:19 2015 +0300<br>
+++ b/src/http/ngx_http_upstream.c      Fri Nov 06 15:22:43 2015 +0300<br>
@@ -772,7 +772,7 @@ ngx_http_upstream_cache(ngx_http_request<br>
             return rc;<br>
         }<br>
<br>
-        if ((r->method & NGX_HTTP_HEAD) && u->conf->cache_convert_head) {<br>
+        if (r->method == NGX_HTTP_HEAD && u->conf->cache_convert_head) {<br>
             u->method = ngx_http_core_get_method;<br>
         }<br>
<br>
<br>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org" target="_blank">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br>
</blockquote></div><br></div></div>