From 5cafee39ef5f530353050c08b5d7c92752174fb1 Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Wed, 4 Jan 2012 19:48:11 +0100 Subject: [PATCH] nginx/upload-module: added patch from upstream to fix range length --- ...e-length-must-equal-to-content-length.diff | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 network/nginx/nginx_upload_module-range-length-must-equal-to-content-length.diff diff --git a/network/nginx/nginx_upload_module-range-length-must-equal-to-content-length.diff b/network/nginx/nginx_upload_module-range-length-must-equal-to-content-length.diff new file mode 100644 index 000000000..83fd3464f --- /dev/null +++ b/network/nginx/nginx_upload_module-range-length-must-equal-to-content-length.diff @@ -0,0 +1,47 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../nginx/nginx_upload_module-range-length-must-equal-to-content-length.diff +# Copyright (C) 2012 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# --- SDE-COPYRIGHT-NOTE-END --- + +From ccbe8f1729223f0193f79bf8f5d739426170bcfd Mon Sep 17 00:00:00 2001 +From: Simon +Date: Sat, 23 Apr 2011 17:39:33 +0800 +Subject: [PATCH 7/8] range length must equal to content length + +--- + ngx_http_upload_module.c | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/ngx_http_upload_module.c b/ngx_http_upload_module.c +index 64c8ca6..9212f57 100644 +--- a/ngx_http_upload_module.c ++++ b/ngx_http_upload_module.c +@@ -3478,6 +3478,14 @@ static ngx_int_t upload_parse_request_headers(ngx_http_upload_ctx_t *upload_ctx, + return NGX_HTTP_REQUEST_ENTITY_TOO_LARGE; + } + ++ if( (upload_ctx->content_range_n.end - upload_ctx->content_range_n.start + 1) ++ != headers_in->content_length_n) ++ { ++ ngx_log_error(NGX_LOG_ERR, upload_ctx->log, 0, ++ "range length is not equal to content length"); ++ return NGX_HTTP_RANGE_NOT_SATISFIABLE; ++ } ++ + upload_ctx->partial_content = 1; + } + } +-- +1.6.6.2 +