Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-788

XMLWS redirects incorrectly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 1.4
    • 1.3.2
    • None
    • Windows 10 x64

      In a plugin, let's say I download the page 'http://www.apage.com/path' using xmlws. If this page does a redirection to path '/redirect', Picard will attempt to load page '/redirect' instead of 'http://www.apage.com/redirect'.

      I can reproduce this with any page on anidb.net that does a redirection.

      To fix it, I added the following monkeypatch to my script (all pages have the string 'animedb.pl' in the path, so I use that to detect this bug).

      if not hasattr(QUrl, 'orig_toString'):
      	QUrl.orig_toString = QUrl.toString
      
      def qturl_toString_monkeypatch(self, options = QUrl.None):
      	if 'animedb.pl' in self.path() and 'anidb.net' not in self.host():
      		log.debug("QUrl.toString Monkeypatch fired!")
      		self.setHost('anidb.net')
      		if 'perl-bin' not in self.path():
      			self.setPath('/perl-bin/%s' % self.path())
      	
      	return QUrl.orig_toString(self, options)
      	
      QUrl.toString = qturl_toString_monkeypatch
      

      Of course, fixing this directly on the xmlws redirect handler would be better.

            Unassigned Unassigned
            ruipgpinheiro Rui Pinheiro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                1.4