[PATCH 1 of 1] Unescape URI in Destination header while handling COPY or MOVE methods

Dhionel Díaz ddiaz at cenditel.gob.ve
Sat Sep 7 23:29:31 UTC 2013


# HG changeset patch
# User Dhionel Díaz <ddiaz at cenditel.gob.ve>
# Date 1378590256 16200
#      Sat Sep 07 17:14:16 2013 -0430
# Node ID 1c6337457a63fb4b1c17b416403ffdd3aa6599e7
# Parent  b95e70ae6bcdbae99a967df01e1011839f19ee0e
Unescape URI in Destination header while handling COPY or MOVE methods.

diff -r b95e70ae6bcd -r 1c6337457a63 src/http/modules/ngx_http_dav_module.c
--- a/src/http/modules/ngx_http_dav_module.c	Thu Sep 05 16:53:02 2013 +0400
+++ b/src/http/modules/ngx_http_dav_module.c	Sat Sep 07 17:14:16 2013 -0430
@@ -515,7 +515,7 @@
 static ngx_int_t
 ngx_http_dav_copy_move_handler(ngx_http_request_t *r)
 {
-    u_char                   *p, *host, *last, ch;
+    u_char                   *p, *src, *host, *last, ch;
     size_t                    len, root;
     ngx_err_t                 err;
     ngx_int_t                 rc, depth;
@@ -608,6 +608,10 @@
     duri.data = p;
     flags = 0;
 
+    src = p;
+    ngx_unescape_uri(&p, &src, duri.len, NGX_UNESCAPE_URI);
+    duri.len = p - duri.data;
+
     if (ngx_http_parse_unsafe_uri(r, &duri, &args, &flags) != NGX_OK) {
         goto invalid_destination;
     }


More information about the nginx-devel mailing list