mirror of
https://github.com/nginx/nginx.git
synced 2024-12-19 05:33:52 -06:00
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).
This commit is contained in:
parent
d97ccc831a
commit
5e5fa2e9e5
@ -312,7 +312,7 @@ ngx_http_dav_delete_handler(ngx_http_request_t *r)
|
|||||||
ngx_file_info_t fi;
|
ngx_file_info_t fi;
|
||||||
ngx_http_dav_loc_conf_t *dlcf;
|
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,
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
||||||
"DELETE with body is unsupported");
|
"DELETE with body is unsupported");
|
||||||
return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
|
return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
|
||||||
@ -495,7 +495,7 @@ ngx_http_dav_mkcol_handler(ngx_http_request_t *r, ngx_http_dav_loc_conf_t *dlcf)
|
|||||||
size_t root;
|
size_t root;
|
||||||
ngx_str_t path;
|
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,
|
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
||||||
"MKCOL with body is unsupported");
|
"MKCOL with body is unsupported");
|
||||||
return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
|
return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
|
||||||
@ -549,7 +549,9 @@ ngx_http_dav_copy_move_handler(ngx_http_request_t *r)
|
|||||||
ngx_http_dav_copy_ctx_t copy;
|
ngx_http_dav_copy_ctx_t copy;
|
||||||
ngx_http_dav_loc_conf_t *dlcf;
|
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;
|
return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user