diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2008-11-20 17:07:22 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2008-11-20 17:07:22 +0000 |
| commit | fc50a8759a11c2e7a2a36793968b2b783a841117 (patch) | |
| tree | 4ff6f54587061bcf06691fe27d448858adf13a38 /src/http/modules/ngx_http_static_module.c | |
| parent | 7405d30f4f544aee24c074ef3747ab64763f6d6e (diff) | |
| download | nginx-fc50a8759a11c2e7a2a36793968b2b783a841117.tar.gz nginx-fc50a8759a11c2e7a2a36793968b2b783a841117.tar.bz2 | |
r2183, r2192 merge:
*) allow file existence test for POST requests in static module
*) do not discard body while error_page redirection
Diffstat (limited to 'src/http/modules/ngx_http_static_module.c')
| -rw-r--r-- | src/http/modules/ngx_http_static_module.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/http/modules/ngx_http_static_module.c b/src/http/modules/ngx_http_static_module.c index c4e688ffb..b8ad57336 100644 --- a/src/http/modules/ngx_http_static_module.c +++ b/src/http/modules/ngx_http_static_module.c @@ -58,7 +58,7 @@ ngx_http_static_handler(ngx_http_request_t *r) ngx_open_file_info_t of; ngx_http_core_loc_conf_t *clcf; - if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) { + if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) { return NGX_HTTP_NOT_ALLOWED; } @@ -71,12 +71,6 @@ ngx_http_static_handler(ngx_http_request_t *r) return NGX_DECLINED; } - rc = ngx_http_discard_request_body(r); - - if (rc != NGX_OK) { - return rc; - } - log = r->connection->log; /* @@ -186,6 +180,16 @@ ngx_http_static_handler(ngx_http_request_t *r) #endif + if (r->method & NGX_HTTP_POST) { + return NGX_HTTP_NOT_ALLOWED; + } + + rc = ngx_http_discard_request_body(r); + + if (rc != NGX_OK) { + return rc; + } + log->action = "sending response to client"; r->headers_out.status = NGX_HTTP_OK; |
