diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-08-17 17:42:42 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-08-17 17:42:42 +0000 |
commit | d3cbd87f50f7bad5530a570a7cf2ffa33230b601 (patch) | |
tree | 837c3051de2cb3a90055f591aec23723f17556de /src/http/modules/ngx_http_static_module.c | |
parent | a03bb0bc77224dc88bddcc86a4c8b98c6bee4a6a (diff) | |
download | nginx-d3cbd87f50f7bad5530a570a7cf2ffa33230b601.tar.gz nginx-d3cbd87f50f7bad5530a570a7cf2ffa33230b601.zip |
allow file existence test for POST requests in static module
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 8d399fccd..7c2768d81 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; /* @@ -203,6 +197,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; |