Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
aefae557
Commit
aefae557
authored
Jul 10, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix wrong header name. The framework looks for auth_header.
parent
b0f5e5a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
Lib/urllib2.py
Lib/urllib2.py
+10
-8
No files found.
Lib/urllib2.py
View file @
aefae557
...
...
@@ -422,11 +422,12 @@ class HTTPRedirectHandler(BaseHandler):
def
redirect_request
(
self
,
req
,
fp
,
code
,
msg
,
headers
,
newurl
):
"""Return a Request or None in response to a redirect.
This is called by the http_error_30x methods when a redirection
response is received. If a redirection should take place, return a new
Request to allow http_error_30x to perform the redirect. Otherwise,
raise HTTPError if no-one else should try to handle this url. Return
None if you can't but another Handler might.
This is called by the http_error_30x methods when a
redirection response is received. If a redirection should
take place, return a new Request to allow http_error_30x to
perform the redirect. Otherwise, raise HTTPError if no-one
else should try to handle this url. Return None if you can't
but another Handler might.
"""
m
=
req
.
get_method
()
if
(
code
in
(
301
,
302
,
303
,
307
)
and
m
in
(
"GET"
,
"HEAD"
)
...
...
@@ -612,7 +613,8 @@ class HTTPPasswordMgr:
class
HTTPPasswordMgrWithDefaultRealm
(
HTTPPasswordMgr
):
def
find_user_password
(
self
,
realm
,
authuri
):
user
,
password
=
HTTPPasswordMgr
.
find_user_password
(
self
,
realm
,
authuri
)
user
,
password
=
HTTPPasswordMgr
.
find_user_password
(
self
,
realm
,
authuri
)
if
user
is
not
None
:
return
user
,
password
return
HTTPPasswordMgr
.
find_user_password
(
self
,
None
,
authuri
)
...
...
@@ -767,7 +769,7 @@ class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):
does not transmit passwords in the clear.
"""
header
=
'Authorization'
auth_
header
=
'Authorization'
def
http_error_401
(
self
,
req
,
fp
,
code
,
msg
,
headers
):
host
=
urlparse
.
urlparse
(
req
.
get_full_url
())[
1
]
...
...
@@ -776,7 +778,7 @@ class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):
class
ProxyDigestAuthHandler
(
BaseHandler
,
AbstractDigestAuthHandler
):
header
=
'Proxy-Authorization'
auth_
header
=
'Proxy-Authorization'
def
http_error_407
(
self
,
req
,
fp
,
code
,
msg
,
headers
):
host
=
req
.
get_host
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment