Mercurial > hg > nginx
changeset 6538:055cbb52ac1d
Dav: return 501 on PUT with ranges (ticket #948).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 16 May 2016 20:37:23 +0300 |
parents | 3ad1064a3aae |
children | d94f57990492 |
files | src/http/modules/ngx_http_dav_module.c src/http/ngx_http_request.c src/http/ngx_http_request.h |
diffstat | 3 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_dav_module.c Mon May 16 16:22:34 2016 +0300 +++ b/src/http/modules/ngx_http_dav_module.c Mon May 16 20:37:23 2016 +0300 @@ -161,6 +161,12 @@ return NGX_HTTP_CONFLICT; } + if (r->headers_in.content_range) { + ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, + "PUT with range is unsupported"); + return NGX_HTTP_NOT_IMPLEMENTED; + } + r->request_body_in_file_only = 1; r->request_body_in_persistent_file = 1; r->request_body_in_clean_file = 1;
--- a/src/http/ngx_http_request.c Mon May 16 16:22:34 2016 +0300 +++ b/src/http/ngx_http_request.c Mon May 16 20:37:23 2016 +0300 @@ -110,6 +110,10 @@ offsetof(ngx_http_headers_in_t, content_length), ngx_http_process_unique_header_line }, + { ngx_string("Content-Range"), + offsetof(ngx_http_headers_in_t, content_range), + ngx_http_process_unique_header_line }, + { ngx_string("Content-Type"), offsetof(ngx_http_headers_in_t, content_type), ngx_http_process_header_line },
--- a/src/http/ngx_http_request.h Mon May 16 16:22:34 2016 +0300 +++ b/src/http/ngx_http_request.h Mon May 16 20:37:23 2016 +0300 @@ -182,6 +182,7 @@ ngx_table_elt_t *user_agent; ngx_table_elt_t *referer; ngx_table_elt_t *content_length; + ngx_table_elt_t *content_range; ngx_table_elt_t *content_type; ngx_table_elt_t *range;