nginx-dav-ext-module icon indicating copy to clipboard operation
nginx-dav-ext-module copied to clipboard

gen-delims (brackets) not escaped in href

Open chrysn opened this issue 6 years ago • 4 comments

When files with brackets ([, ]) in their file names are listed, those characters are not escaped, causing some clients to ignore them. (This was previously pointed out as a bug in davfs2, but found to be on nginx-dav-ext-module's side).

Characters not in pchar (from Simple-ref via path-absolute and segment) should be escaped per RFCs 4918 and 3986.

A working solution is to replace, in the two calls to ngx_escape_uri in ngx_http_dav_ext_module.c, NGX_ESCAPE_URI with NGX_ESCAPE_URI_PATH, which is a new version that'd need to be introduced in ngx_string.[hc]. It leaves the slashes unharmed but escapes almost everything else (so it's a copy of NGX_ESCAPE_ARGS but with the slash left unescaped). I can't really propose that change to upstream before dav-ext-module acknowledges its use case, so: would that work for you?

(This is a successor to #6, which started escaping but only solved the cases many more clients are sensitive to, but not all the cases of not being pchar.)

chrysn avatar Aug 08 '19 08:08 chrysn

Replace it with NGX_ESCAPE_URI_PATH throw errors when compile the source, so I checked the doc: Screenshot_20200222-083227~2 Then replace it with NGX_ESCAPE_URI_COMPONENT, reconpile the module, and everything works fine now.

Kihara777 avatar Feb 22 '20 00:02 Kihara777

Why does issue is still open, if it was fixed in https://github.com/MkfsSion/nginx-dav-ext-module/commit/efbadc174a64c38b8df806685aa21aa0ed3120c6

?

@MkfsSion @chrysn

notaLonelyDay avatar Mar 03 '24 17:03 notaLonelyDay