Review Request 115689: Fix khtml/ecma/xmlhttprequest.cpp to properly handle HEAD requests

Andrea Iacovitti aiacovitti at libero.it
Sun Feb 16 00:42:23 GMT 2014


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


Because of CustomHTTPMethod i think changes are also needed in kio_http's POST to GET redirection code:

--- kdelibs/kioslave/http/http.cpp
+++ kdelibs/kioslave/http/http.cpp
@@ -3099,16 +3099,17 @@
             // this way of doing things! Thus, we are forced to do the same
             // thing here. Otherwise, we loose compatibility and might not be
             // able to correctly retrieve sites that redirect.
+            const QByteArray method = m_request.methodString();
             switch (m_request.responseCode) {
               case 301: // Moved Permanently
                 setMetaData(QLatin1String("permanent-redirect"), QLatin1String("true"));
-                if (m_request.method == HTTP_POST) {
+                if (method == "POST ") {
                     m_request.method = HTTP_GET; // FORCE a GET
                     setMetaData(QLatin1String("redirect-to-get"), QLatin1String("true"));
                 }
                 break;
               case 302: // Found
-                if (m_request.method == HTTP_POST) {
+                if (method == "POST ") {
                     m_request.method = HTTP_GET; // FORCE a GET
                     setMetaData(QLatin1String("redirect-to-get"), QLatin1String("true"));
                 }


- Andrea Iacovitti


On Feb. 14, 2014, 4 p.m., Dawit Alemayehu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115689/
> -----------------------------------------------------------
> 
> (Updated Feb. 14, 2014, 4 p.m.)
> 
> 
> Review request for kdelibs and Andrea Iacovitti.
> 
> 
> Bugs: 331007
>     http://bugs.kde.org/show_bug.cgi?id=331007
> 
> 
> Repository: kdelibs
> 
> 
> Description
> -------
> 
> Fix khtml/ecma/xmlttprequest.cpp such that it correctly handles HEAD requests without a noticable delay, i.e. use KIO::mimeType instead of KIO::get. Otherwise, the request will wait for the content which is not returned when doing a stat operation like HEAD.
> 
> 
> Diffs
> -----
> 
>   khtml/ecma/xmlhttprequest.cpp b3707e7 
>   kio/kio/job.cpp abb3dfd 
> 
> Diff: https://git.reviewboard.kde.org/r/115689/diff/
> 
> 
> Testing
> -------
> 
> Tested HEAD redirection with http://greenbytes.de/tech/tc/httpredirects/
> 
> 
> Thanks,
> 
> Dawit Alemayehu
> 
>

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


More information about the kde-core-devel mailing list