masperro / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

Infinite Loop on Cached 301 Redirects #98

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Have two cached 301 redirects that redirect to each other
2. Request the page

What is the expected output? What do you see instead?
Expect a RedirectLimit to be raised.  Instead got a max recursion depth 
exceeded error.

What version of the product are you using? On what operating system?
0.6.0 on Ubuntu 8.04

Please provide any additional information below.
Here's the contents of the cache for the URLs that caused the max recursion 
error:

status: 301
content-length: 325
content-location: http://www.ovpr.uga.edu/news/index.html
server: Apache/2.2.3 (Red Hat)
connection: close
location: http://ovpr.uga.edu/news/index.html
date: Thu, 08 Apr 2010 16:13:09 GMT
-x-permanent-redirect-url: http://ovpr.uga.edu/news/index.html
content-type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a 
href="http://ovpr.uga.edu/news/index.html">here</a>.</p>
<hr>
<address>Apache/2.2.3 (Red Hat) Server at www.ovpr.uga.edu Port 
80</address>
</body></html>

status: 301
content-length: 325
content-location: http://ovpr.uga.edu/news/index.html
server: Apache/2.2.3 (Red Hat)
connection: close
location: http://www.ovpr.uga.edu/news/index.html
date: Thu, 08 Apr 2010 16:13:09 GMT
-x-permanent-redirect-url: http://www.ovpr.uga.edu/news/index.html
content-type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a 
href="http://www.ovpr.uga.edu/news/index.html">here</a>.</p>
<hr>
<address>Apache/2.2.3 (Red Hat) Server at ovpr.uga.edu Port 80</address>
</body></html>

The result was a maximum recursion depth exceeded error:
...
...
...
  File "/usr/local/lib/python2.5/site-packages/httplib2/__init__.py", line 
1068, in request
    (response, new_content) = self.request(info['-x-permanent-redirect-
url'], "GET", headers = headers, redirections = redirections - 1)
  File "/usr/local/lib/python2.5/site-packages/httplib2/__init__.py", line 
1068, in request
    (response, new_content) = self.request(info['-x-permanent-redirect-
url'], "GET", headers = headers, redirections = redirections - 1)
  File "/usr/local/lib/python2.5/site-packages/httplib2/__init__.py", line 
1068, in request
    (response, new_content) = self.request(info['-x-permanent-redirect-
url'], "GET", headers = headers, redirections = redirections - 1)
  File "/usr/local/lib/python2.5/site-packages/httplib2/__init__.py", line 
1068, in request
    (response, new_content) = self.request(info['-x-permanent-redirect-
url'], "GET", headers = headers, redirections = redirections - 1)
  File "/usr/local/lib/python2.5/site-packages/httplib2/__init__.py", line 
1036, in request
    info = feedparser.close()
  File "/usr/local/lib/python2.5/email/feedparser.py", line 164, in close
    self._call_parse()
  File "/usr/local/lib/python2.5/email/feedparser.py", line 157, in 
_call_parse
    self._parse()
  File "/usr/local/lib/python2.5/email/feedparser.py", line 266, in 
_parsegen
    if self._cur.get_content_maintype() == 'message':
  File "/usr/local/lib/python2.5/email/message.py", line 451, in 
get_content_maintype
    ctype = self.get_content_type()
  File "/usr/local/lib/python2.5/email/message.py", line 435, in 
get_content_type
    value = self.get('content-type', missing)
  File "/usr/local/lib/python2.5/email/message.py", line 354, in get
    if k.lower() == name:
RuntimeError: maximum recursion depth exceeded in cmp

Original issue reported on code.google.com by stephen....@gmail.com on 8 Apr 2010 at 7:08

GoogleCodeExporter commented 8 years ago
This issue was closed by revision cf7232378f.

Original comment by joe.gregorio@gmail.com on 15 Feb 2011 at 4:30