]> git.kaiwu.me - nginx.git/commitdiff
Dav: return 501 on PUT with ranges (ticket #948).
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 16 May 2016 17:37:23 +0000 (20:37 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 16 May 2016 17:37:23 +0000 (20:37 +0300)
src/http/modules/ngx_http_dav_module.c
src/http/ngx_http_request.c
src/http/ngx_http_request.h

index 36002656b20aba3ed2149f442e4768caac77326a..012a0fba84b1dd4d3b125c9e767e8b42f3cc13bb 100644 (file)
@@ -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;
index aa3c398a36946c8773ee31263df9b2cec6d9e80e..8665e5bd5a6a7866bdc003c7a6e50394534c52f5 100644 (file)
@@ -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 },
index cfde7dc7ed5c3e6b3b4d8f60247bb851b12264bf..fcd50de4519d1f27486ea91aa0bb0745a45bc017 100644 (file)
@@ -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;