nginx-ilves/fix-displayName.patch

36 lines
1.1 KiB
Diff

From fa4969880916bbc1634576cd9edcefe3d40e521b Mon Sep 17 00:00:00 2001
From: Mattias Wadman <mattias.wadman@gmail.com>
Date: Fri, 22 May 2015 15:43:42 +0200
Subject: [PATCH] Use path basename instead of URI basename as displayName
Display name value is a text node so it should not use be URL encoded.
Fixes issue withspace and other characters showing as %20 etc.
---
ngx_http_dav_ext_module.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/ngx_http_dav_ext_module.c b/ngx_http_dav_ext_module.c
index 73d86de..f53819c 100644
--- a/ngx_http_dav_ext_module.c
+++ b/ngx_http_dav_ext_module.c
@@ -328,16 +328,9 @@ ngx_http_dav_ext_send_propfind_atts(ngx_http_request_t *r,
"<D:displayname>"
);
- if (uri->len) {
-
- for(name.data = uri->data + uri->len;
- name.data >= uri->data + 1 && name.data[-1] != '/';
- --name.data);
-
- name.len = uri->data + uri->len - name.data;
-
- NGX_HTTP_DAV_EXT_OUTES(&name);
- }
+ name.data = strrchr(path, '/') + 1;
+ name.len = strlen(name.data);
+ NGX_HTTP_DAV_EXT_OUTES(&name);
NGX_HTTP_DAV_EXT_OUTL(
"</D:displayname>\n"