From 2fdcc1607dabcf73698d1525a9d1b857abcbb7af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Sun, 11 Oct 2009 14:03:02 +0200 Subject: [PATCH] Fix redirection handling --- picard/webservice.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/picard/webservice.py b/picard/webservice.py index 4521e853c..45cdf412b 100644 --- a/picard/webservice.py +++ b/picard/webservice.py @@ -147,8 +147,11 @@ class XmlWebService(QtNetwork.QHttp): location = response.value("Location") if location: self.log.debug("Redirect => %s", location) - location = QtCore.QUrl(location) - self.get(location.host(), location.port(80), location.path(), handler, xml=xml, position=1) + location = QtCore.QUrl.fromEncoded(str(location)) + path = location.path() + if location.hasQuery(): + path += '?' + location.encodedQuery() + self.get(location.host(), location.port(80), path, handler, xml=xml, position=1) # don't call the handle for this request, only for the redirected one handler = None