Mercurial > hg > nginx-mail
comparison src/http/modules/ngx_http_autoindex_module.c @ 665:0b460e61bdcd default tip
Merge with nginx 1.0.0.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 25 Apr 2011 04:22:17 +0400 |
parents | ff463db0be31 |
children |
comparison
equal
deleted
inserted
replaced
572:06419a2298a9 | 665:0b460e61bdcd |
---|---|
158 | 158 |
159 if (r->uri.data[r->uri.len - 1] != '/') { | 159 if (r->uri.data[r->uri.len - 1] != '/') { |
160 return NGX_DECLINED; | 160 return NGX_DECLINED; |
161 } | 161 } |
162 | 162 |
163 if (r->zero_in_uri) { | |
164 return NGX_DECLINED; | |
165 } | |
166 | |
167 if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) { | 163 if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) { |
168 return NGX_DECLINED; | 164 return NGX_DECLINED; |
169 } | 165 } |
170 | 166 |
171 alcf = ngx_http_get_module_loc_conf(r, ngx_http_autoindex_module); | 167 alcf = ngx_http_get_module_loc_conf(r, ngx_http_autoindex_module); |
233 return ngx_http_autoindex_error(r, &dir, &path); | 229 return ngx_http_autoindex_error(r, &dir, &path); |
234 } | 230 } |
235 | 231 |
236 r->headers_out.status = NGX_HTTP_OK; | 232 r->headers_out.status = NGX_HTTP_OK; |
237 r->headers_out.content_type_len = sizeof("text/html") - 1; | 233 r->headers_out.content_type_len = sizeof("text/html") - 1; |
238 r->headers_out.content_type.len = sizeof("text/html") - 1; | 234 ngx_str_set(&r->headers_out.content_type, "text/html"); |
239 r->headers_out.content_type.data = (u_char *) "text/html"; | |
240 | 235 |
241 rc = ngx_http_send_header(r); | 236 rc = ngx_http_send_header(r); |
242 | 237 |
243 if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { | 238 if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { |
244 if (ngx_close_dir(&dir) == NGX_ERROR) { | 239 if (ngx_close_dir(&dir) == NGX_ERROR) { |