Welcome! Log In Create A New Profile

Advanced

[nginx] Dav: return 501 on PUT with ranges (ticket #948).

Maxim Dounin
May 16, 2016 01:42PM
details: http://hg.nginx.org/nginx/rev/055cbb52ac1d
branches:
changeset: 6538:055cbb52ac1d
user: Maxim Dounin <mdounin@mdounin.ru>
date: Mon May 16 20:37:23 2016 +0300
description:
Dav: return 501 on PUT with ranges (ticket #948).

diffstat:

src/http/modules/ngx_http_dav_module.c | 6 ++++++
src/http/ngx_http_request.c | 4 ++++
src/http/ngx_http_request.h | 1 +
3 files changed, 11 insertions(+), 0 deletions(-)

diffs (41 lines):

diff --git a/src/http/modules/ngx_http_dav_module.c b/src/http/modules/ngx_http_dav_module.c
--- 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
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
--- 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
--- 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;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Dav: return 501 on PUT with ranges (ticket #948).

Maxim Dounin 609 May 16, 2016 01:42PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 174
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready