Review Request 116122: Do not add trailing slash on http DELETE requests

Dawit Alemayehu adawit at kde.org
Fri Mar 7 05:14:36 GMT 2014



> On March 6, 2014, 9:10 p.m., Andrea Iacovitti wrote:
> > I tested your patch, no trailing slash is added whether the request refers to a collection or resource (as it was before commit 58294ac).
> 
> Dawit Alemayehu wrote:
>     Right, but now the webdav server should redirect to the right address (with trailing slash) and that redirect should succeed. I guess we can always add a trailing slash if there are servers that do not redirect or we want to avoid the redirect.
> 
> Andrea Iacovitti wrote:
>     Well, not mine, i get a 204 and the forlder successfully deleted.
>

Well that is fine. If you try one of the test servers I listed above, you will see that deleting directory without a trailing slash results in a 302 response that redirects you to the same directory but with the trailing slash appended.

The problem before this patch was that redirection would have simply been ignored. That is because the code in DeleteJobPrivate::deleteNextSrc blindly calls KIO::rmdir even for http/webdav resources. And Since KIO::rmdir uses DeleteJob which inherits from SimpleJob, there is no support for redirection. You need TransferJob or its descendents if the protocol requires redirection support. Once we convert to properly call KIO::http_delete for HTTP based protocols, then it works as expected because we will be able to handle the redirection of the delete request.

Anyhow, all I was suggesting in my prior response above for us to optimize the directory deletion requests for the servers that require trailing slash. That way we avoid the additional redirection when requesting deletion from such servers without impacting those servers that do not care about the trailing slash.


- Dawit


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/116122/#review52294
-----------------------------------------------------------


On March 5, 2014, 2:01 p.m., Dawit Alemayehu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/116122/
> -----------------------------------------------------------
> 
> (Updated March 5, 2014, 2:01 p.m.)
> 
> 
> Review request for kdelibs, Andrea Iacovitti and David Faure.
> 
> 
> Bugs: 331295
>     http://bugs.kde.org/show_bug.cgi?id=331295
> 
> 
> Repository: kdelibs
> 
> 
> Description
> -------
> 
> This patch fixes a prior commit, http://commits.kde.org/kdelibs/58294ac, which attempted to workaround webdav servers that do not accept delete requests on directories unless there is a trailing slash. It ensures that the "fix" is only applicable to webdav and the addition of the trailing slash is communicated to the client application.
> 
> 
> Diffs
> -----
> 
>   kio/kio/deletejob.cpp b0268ef 
>   kioslave/http/http.cpp b4d64d4 
> 
> Diff: https://git.reviewboard.kde.org/r/116122/diff/
> 
> 
> Testing
> -------
> 
> For HTTP delete:
> http://greenbytes.de/tech/tc/httpredirects/t301methods.html
> 
> For WebDAV delete:
> http://boonfaya.com/sites/webdavapps.com/#targets
> 
> 
> Thanks,
> 
> Dawit Alemayehu
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20140307/6b4b0cfb/attachment.htm>


More information about the kde-core-devel mailing list