Summary: | Saving a file with HTTP doesn't follow HTTP 307 redirects | ||
---|---|---|---|
Product: | [Unmaintained] kio | Reporter: | bert |
Component: | http | Assignee: | kdelibs bugs <kdelibs-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | adawit, cfeck, christoph |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian stable | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.7.3 | |
Sentry Crash Report: |
Description
bert
2011-02-24 16:37:51 UTC
kdelibs bug Sorry but this is not really a HTTP or kdelibs bug. kate or kwrite or any application for that matter needs to deal with the possiblity of a redirection for such operations. Only redirection of a POST operation is handled automatically and even that happens for historical reason. If a server redirects a POST operation, then it is automatically converted into a GET operation (a relatively benign action). However, that is not the case for a PUT operation. If the server redirects a PUT operation, then it is the client's responsiblity to confirm whether that action is desired and put a new request with the redirection url. To achieve this the client application must connect to the job's redirection signal and store the redirection url. Then if it gets an error message, it needs to redo the request with the newly saved url. Sorry, but there is no way around that. KParts handles the uploading for us, see save/saveAs in read-write-part. It must be fixed there or any other kparts part must reimplement that methods. Dawit, can you clarify if this can be fixed in kio? It clearly isn't an kdeui bug. (In reply to comment #4) > Dawit, can you clarify if this can be fixed in kio? It clearly isn't an kdeui > bug. Not sure, but this needs further investigation based on feedback in comment #3. Please disregard what I stated in comment #2 since it is factually incorrect. Redirection are always handled internally by KIO ; so this could not be the fault of the application. However, to find out what might be causing this issue, we need access to a server where we can reproduce this issue or otherwise provide the debug out from such session. I know why this happens now. It is a kio_http bug caused by the fact that its PUT handling does not account for redirection. Will be fixed soon. Git commit 3f697e30d28d311015484a01e67e8bb95477e7fa by Dawit Alemayehu. Committed on 22/10/2011 at 02:07. Pushed by adawit into branch 'KDE/4.7'. Make sure both DELETE and PUT requests properly handle redirection requests to address the issue reported in bug# 267063. In the process of addressing the afformentioned bug the following related changes and cleanups were performed: - Removed the check for HTTP_POST on redirection so that kio_http behaves exactly like Firefox and Chromium except for HEAD requests. Converting HEAD requests to GET makes no sense. - Changed both ::del and ::put to leave the query component of the request URL alone except for WebDAV requests. Not sure why it is removed for DAV requests either. - Changed ::del to properly handles any message body returned by the server. - Renamed sendHttpPutError to sendHttpError and converted it to handle HTTP response code errors for all HTTP methods, not just PUT. - Changed proceedUntilResponseContent to use the new sendHttpError function to send error to the client. - Converted both ::del and ::put to use proceedUntilResponseContent since it now correctly handles errors returned by the server. BUG: 267063 FIXED-IN: 4.7.3 M +172 -102 kioslave/http/http.cpp M +3 -2 kioslave/http/http.h http://commits.kde.org/kdelibs/3f697e30d28d311015484a01e67e8bb95477e7fa |