[Python-bugs-list] [ python-Bugs-776542 ] urllib: open_https generates wrong Authorize header

SourceForge.net noreply at sourceforge.net
Wed Aug 13 18:01:46 EDT 2003


Bugs item #776542, was opened at 2003-07-23 17:40
Message generated for change (Settings changed) made by akuchling
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=776542&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Steffen Ries (sries)
>Assigned to: A.M. Kuchling (akuchling)
Summary: urllib: open_https generates wrong Authorize header

Initial Comment:
When opening an https page which requires
authentication, the "Authorization" header is created
incorrectly by open_https(). open_http() uses the
correct method.

The fix is a simple one line change:

*** /usr/local/lib/python2.2/urllib.py  Fri Oct  4
18:57:01 2002
--- urllib.py   Wed Jul 23 17:23:41 2003
***************
*** 364,370 ****
                  h.putheader('Content-length', '%d' %
len(data))
              else:
                  h.putrequest('GET', selector)
!             if auth: h.putheader('Authorization:
Basic %s' % auth)
              if realhost: h.putheader('Host', realhost)
              for args in self.addheaders:
apply(h.putheader, args)
              h.endheaders()
--- 364,370 ----
                  h.putheader('Content-length', '%d' %
len(data))
              else:
                  h.putrequest('GET', selector)
!             if auth: h.putheader('Authorization',
'Basic %s' % auth)
              if realhost: h.putheader('Host', realhost)
              for args in self.addheaders:
apply(h.putheader, args)
              h.endheaders()


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=776542&group_id=5470



More information about the Python-bugs-list mailing list