Maxim Dounin
December 23, 2019 12:44PM
details: https://hg.nginx.org/nginx/rev/f609c0ac2972
branches:
changeset: 7609:f609c0ac2972
user: Maxim Dounin <mdounin@mdounin.ru>
date: Mon Dec 23 20:39:27 2019 +0300
description:
Dav: added checks for chunked to body presence conditions.

These checks were missed when chunked support was introduced. And also
added an explicit error message to ngx_http_dav_copy_move_handler()
(it was missed for some reason, in contrast to DELETE and MKCOL handlers).

diffstat:

src/http/modules/ngx_http_dav_module.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)

diffs (32 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
@@ -312,7 +312,7 @@ ngx_http_dav_delete_handler(ngx_http_req
ngx_file_info_t fi;
ngx_http_dav_loc_conf_t *dlcf;

- if (r->headers_in.content_length_n > 0) {
+ if (r->headers_in.content_length_n > 0 || r->headers_in.chunked) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"DELETE with body is unsupported");
return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
@@ -495,7 +495,7 @@ ngx_http_dav_mkcol_handler(ngx_http_requ
size_t root;
ngx_str_t path;

- if (r->headers_in.content_length_n > 0) {
+ if (r->headers_in.content_length_n > 0 || r->headers_in.chunked) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"MKCOL with body is unsupported");
return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
@@ -549,7 +549,9 @@ ngx_http_dav_copy_move_handler(ngx_http_
ngx_http_dav_copy_ctx_t copy;
ngx_http_dav_loc_conf_t *dlcf;

- if (r->headers_in.content_length_n > 0) {
+ if (r->headers_in.content_length_n > 0 || r->headers_in.chunked) {
+ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+ "COPY and MOVE with body are unsupported");
return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
}

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

[nginx] Dav: added checks for chunked to body presence conditions.

Maxim Dounin 463 December 23, 2019 12:44PM



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

Online Users

Guests: 226
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