WebDAV: Trailing slash for DELETE and MOVE on dirs#1535
WebDAV: Trailing slash for DELETE and MOVE on dirs#1535njam wants to merge 2 commits intozhanghai:masterfrom
Conversation
According to WebDAV RFC when issuing a MOVE or DELETE on a folder (instead of a file), the path should have a trailing slash. For example the nginx webdav server requires this for it to work.
|
I indeed don't like a new PROPFIND, in addition to more code logic for this... And since it's a SHOULD (i.e. merely RECOMMENDED and can be ignored, according to RFC 2119) instead of MUST, I feel nginx is supposed to handle both cases to be compliant instead of every client being forced to take SHOULD as MUST and have more complicated logic or send extra requests. |
… deleting WebDAV files.
|
Yeah it's better to avoid an additional PROPFIND. There are actually already 2 PROPFIND before deleting a file, and 4 before deleting a directory. It is better not to add another one. I agree, Nginx should handle this differently. But it's unlikely that they will change it. Without changing MaterialFiles' implementation it won't work together with Nginx. As you say it's "recommended" to add the trailing slash, so it's definitely better to add it than not to add it. I've pushed a commit that changes wdyt? |
91a40b0 to
fc12500
Compare
According to WebDAV RFC when issuing a MOVE or DELETE on a folder (instead of a file), the path should have a trailing slash.
Fixes #1475
@zhanghai do you accept contributions?
I've tested it against the Nginx webdav server.
The only downside with this change I can see is that it adds one more PROPFIND when deleting files or folders. It guess it could be avoided, but would require quite some code changes, to pass along the information whether the path to be deleted is a file or a folder.