aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2016-05-16 20:37:23 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2016-05-16 20:37:23 +0300
commit099d74cf3d62a092e51ef7dbba9dace68aca7209 (patch)
treed204f6e1b1bbf7e520b03b585a7c3d1f63cc9cb0 /src
parent7850609cf916a2fcb3a05f0ed05ae4d3f9dbcde7 (diff)
downloadnginx-099d74cf3d62a092e51ef7dbba9dace68aca7209.tar.gz
nginx-099d74cf3d62a092e51ef7dbba9dace68aca7209.zip
Dav: return 501 on PUT with ranges (ticket #948).
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_dav_module.c6
-rw-r--r--src/http/ngx_http_request.c4
-rw-r--r--src/http/ngx_http_request.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_dav_module.c b/src/http/modules/ngx_http_dav_module.c
index 36002656b..012a0fba8 100644
--- a/src/http/modules/ngx_http_dav_module.c
+++ b/src/http/modules/ngx_http_dav_module.c
@@ -161,6 +161,12 @@ ngx_http_dav_handler(ngx_http_request_t *r)
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;
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index aa3c398a3..8665e5bd5 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -110,6 +110,10 @@ ngx_http_header_t ngx_http_headers_in[] = {
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 },
diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h
index cfde7dc7e..fcd50de45 100644
--- a/src/http/ngx_http_request.h
+++ b/src/http/ngx_http_request.h
@@ -182,6 +182,7 @@ typedef struct {
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;