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

SourceForge.net noreply@sourceforge.net
Wed, 23 Jul 2003 14:40:53 -0700


Bugs item #776542, was opened at 2003-07-23 17:40
Message generated for change (Tracker Item Submitted) made by Item Submitter
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: Nobody/Anonymous (nobody)
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