Senthil Kumaran added the comment:
Just for the explaination (as the report already closed), getheaders of
HTTPMessage object is available by subclassing all the way from rfc822.py
module. If you trace it through the debugger, you will come to know.
--
___
Andres Riancho added the comment:
Yes, the traceback was in my code because as I stated before: "my w3af code had
a section of urllib2's code in logHandler.py" in other words, I copy+pasted a
section of urllib2 into my code.
Can't provide a test case now, sorry.
--
_
R. David Murray added the comment:
The traceback you point to seems to indicate the getheaders call is in your
code.
Can you provide a minimal test case that demonstrates the failure mode you are
concerned about?
--
nosy: +r.david.murray
___
Pytho
Andres Riancho added the comment:
One more comment to be added. Please take a look at the following [0] w3af bug
report. The interesting part starts at "[ Sun Nov 28 01:25:47 2010 - debug ]
Traceback (most recent call last):".
In there you'll find that my w3af code had a section of urllib2's
Andres Riancho added the comment:
Please take a deeper look. I think you're trusting the "old code" more than my
bug report. Some things to keep in mind:
* The "headers" parameter is a dict. It will never have a getheaders method
* The If you search the whole urllib2.py file, you won't find
Senthil Kumaran added the comment:
Andres, the HTTP Response is sent the xxx_error_xxx method when it is handled
by RedirectHandler. Does the below code not work for you in case? I am unable
to see the problem here (and also this piece of code is present from 2004!) I
am inclined to mark this
New submission from Andres Riancho :
Buggy Code:
"""
def http_error_302(self, req, fp, code, msg, headers):
# Some servers (incorrectly) return multiple Location headers
# (so probably same goes for URI). Use first header.
if 'location' in headers:
newurl