From 53fbd6d01dc921c203860523649df59033751ca9 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Wed, 15 Aug 2007 20:30:36 +0000 Subject: 302 is also a valid redirect. Also keep the original query when redirecting. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14362 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/rbutilqt/httpget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rbutil/rbutilqt/httpget.cpp') diff --git a/rbutil/rbutilqt/httpget.cpp b/rbutil/rbutilqt/httpget.cpp index 1f9205e58b..60c8a58a6d 100644 --- a/rbutil/rbutilqt/httpget.cpp +++ b/rbutil/rbutilqt/httpget.cpp @@ -111,7 +111,6 @@ bool HttpGet::getFile(const QUrl &url) http.setHost(url.host(), url.port(80)); // construct query (if any) QList > qitems = url.queryItems(); - QString query; if(url.hasQuery()) { query = "?"; for(int i = 0; i < qitems.size(); i++) @@ -177,13 +176,14 @@ void HttpGet::httpResponseHeader(const QHttpResponseHeader &resp) http.abort(); } // 301 -- moved permanently + // 302 -- found // 303 -- see other // 307 -- moved temporarily // in all cases, header: location has the correct address so we can follow. - if(response == 301 || response == 303 || response == 307) { + if(response == 301 || response == 302 || response == 303 || response == 307) { // start new request with new url qDebug() << "http response" << response << "- following"; - getFile(resp.value("location")); + getFile(resp.value("location") + query); } } -- cgit v1.2.3