Fix redirection handling

This commit is contained in:
Lukáš Lalinský
2009-10-11 14:03:02 +02:00
parent 7bfcb6f509
commit 2fdcc1607d

View File

@@ -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