From 080e0a227efb26eca0fecf122add0a620a94dc26 Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Thu, 19 Jan 2017 18:58:04 +0200 Subject: [PATCH] Add a patch that fixes display names for files in webdav --- PKGBUILD | 7 ++++++- fix-displayName.patch | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 fix-displayName.patch diff --git a/PKGBUILD b/PKGBUILD index 5218594..b92ed2c 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -6,7 +6,7 @@ pkgname=nginx-ilves pkgver=1.11.8 -pkgrel=2 +pkgrel=3 pkgdesc='Lightweight HTTP server and IMAP/POP3 proxy server, mainline release' arch=('i686' 'x86_64') url='https://nginx.org' @@ -30,6 +30,7 @@ source=($url/download/nginx-$pkgver.tar.gz{,.asc} service logrotate ngx_davext.tar.gz::https://github.com/arut/nginx-dav-ext-module/archive/v0.0.3.tar.gz + fix-displayName.patch ngx_fancyindex.tar.gz::https://github.com/aperezdc/ngx-fancyindex/archive/v0.4.1.tar.gz) validpgpkeys=('B0F4253373F8F6F510D42178520A9993A1C052F8') # Maxim Dounin md5sums=('8f68f49b6db510e567bba9e0c271a3ac' @@ -37,6 +38,7 @@ md5sums=('8f68f49b6db510e567bba9e0c271a3ac' 'ce9a06bcaf66ec4a3c4eb59b636e0dfd' 'd6a6d4d819f03a675bacdfabd25aa37e' '2cb502dbda335be4ebd5fed0b3182bae' + '16c5dbad002ae88eadb66aa1a13389c2' 'e1dd79f0ec82415bbf8a1cb938988955') _common_flags=( @@ -73,6 +75,9 @@ _mainline_flags=( build() { mv nginx-dav-ext-module* ngx_davext + cd ngx_davext + patch -p1 -i ../../fix-displayName.patch + cd .. mv ngx-fancyindex-* ngx_fancyindex cd $provides-$pkgver diff --git a/fix-displayName.patch b/fix-displayName.patch new file mode 100644 index 0000000..5c9e4ab --- /dev/null +++ b/fix-displayName.patch @@ -0,0 +1,35 @@ +From fa4969880916bbc1634576cd9edcefe3d40e521b Mon Sep 17 00:00:00 2001 +From: Mattias Wadman +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, + "" + ); + +- 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( + "\n"