Skip to content

Commit

Permalink
Dav: return 501 on PUT with ranges (ticket #948).
Browse files Browse the repository at this point in the history
  • Loading branch information
mdounin committed May 16, 2016
1 parent 7850609 commit 099d74c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/http/modules/ngx_http_dav_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/http/ngx_http_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
1 change: 1 addition & 0 deletions src/http/ngx_http_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 099d74c

Please sign in to comment.