Commits

Chris Adams committed 44ca7c1

Clients: spider now has minimal circular redirect handling

This should become nicer than an assertion error at some point

  • Participants
  • Parent commits 30a0489

Comments (0)

Files changed (1)

File webtoolbox/clients.py

             url = response.headers['Location']
             self.redirect_map[request.url] = url
 
+            assert not url in self.redirect_map or self.redirect_map[url] != request.url, "Circular redirect: %s %s" % (url, self.redirect_map[url])
+
         parsed_url = urlparse(url)
 
         self.site_structure[url].code = response.code