comparison src/http/modules/ngx_http_static_module.c @ 398:9d81578d04bb NGINX_0_7_11

nginx 0.7.11 *) Change: now ngx_http_charset_module does not work by default with text/css MIME type. *) Feature: now nginx returns the 405 status code for POST method requesting a static file only if the file exists. *) Feature: the "proxy_ssl_session_reuse" directive. *) Bugfix: a "proxy_pass" directive without URI part might use original request after the "X-Accel-Redirect" redirection was used; *) Bugfix: if a directory has search only rights and the first index file was absent, then nginx returned the 500 status code. *) Bugfix: in inclusive locations; the bugs had appeared in 0.7.1.
author Igor Sysoev <http://sysoev.ru>
date Mon, 18 Aug 2008 00:00:00 +0400
parents 0b6053502c55
children 79c5df00501e
comparison
equal deleted inserted replaced
397:47d42325b5fd 398:9d81578d04bb
56 ngx_buf_t *b; 56 ngx_buf_t *b;
57 ngx_chain_t out; 57 ngx_chain_t out;
58 ngx_open_file_info_t of; 58 ngx_open_file_info_t of;
59 ngx_http_core_loc_conf_t *clcf; 59 ngx_http_core_loc_conf_t *clcf;
60 60
61 if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) { 61 if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
62 return NGX_HTTP_NOT_ALLOWED; 62 return NGX_HTTP_NOT_ALLOWED;
63 } 63 }
64 64
65 if (r->uri.data[r->uri.len - 1] == '/') { 65 if (r->uri.data[r->uri.len - 1] == '/') {
66 return NGX_DECLINED; 66 return NGX_DECLINED;
67 } 67 }
68 68
69 /* TODO: Win32 */ 69 /* TODO: Win32 */
70 if (r->zero_in_uri) { 70 if (r->zero_in_uri) {
71 return NGX_DECLINED; 71 return NGX_DECLINED;
72 }
73
74 rc = ngx_http_discard_request_body(r);
75
76 if (rc != NGX_OK) {
77 return rc;
78 } 72 }
79 73
80 log = r->connection->log; 74 log = r->connection->log;
81 75
82 /* 76 /*
201 return NGX_HTTP_NOT_FOUND; 195 return NGX_HTTP_NOT_FOUND;
202 } 196 }
203 197
204 #endif 198 #endif
205 199
200 if (r->method & NGX_HTTP_POST) {
201 return NGX_HTTP_NOT_ALLOWED;
202 }
203
204 rc = ngx_http_discard_request_body(r);
205
206 if (rc != NGX_OK) {
207 return rc;
208 }
209
206 log->action = "sending response to client"; 210 log->action = "sending response to client";
207 211
208 r->headers_out.status = NGX_HTTP_OK; 212 r->headers_out.status = NGX_HTTP_OK;
209 r->headers_out.content_length_n = of.size; 213 r->headers_out.content_length_n = of.size;
210 r->headers_out.last_modified_time = of.mtime; 214 r->headers_out.last_modified_time = of.mtime;