Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e99bd17e
Kaydet (Commit)
e99bd17e
authored
Şub 27, 2001
tarafından
Moshe Zadka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixing bug #227562 by calling URLopener.http_error_default when
an invalid 401 request is being handled.
üst
be77cf7d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
urllib.py
Lib/urllib.py
+18
-12
No files found.
Lib/urllib.py
Dosyayı görüntüle @
e99bd17e
...
@@ -560,18 +560,24 @@ class FancyURLopener(URLopener):
...
@@ -560,18 +560,24 @@ class FancyURLopener(URLopener):
"""Error 401 -- authentication required.
"""Error 401 -- authentication required.
See this URL for a description of the basic authentication scheme:
See this URL for a description of the basic authentication scheme:
http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt"""
http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt"""
if
headers
.
has_key
(
'www-authenticate'
):
if
not
headers
.
has_key
(
'www-authenticate'
):
stuff
=
headers
[
'www-authenticate'
]
URLopener
.
http_error_default
(
self
,
url
,
fp
,
import
re
errmsg
,
headers
)
match
=
re
.
match
(
'[
\t
]*([^
\t
]+)[
\t
]+realm="([^"]*)"'
,
stuff
)
stuff
=
headers
[
'www-authenticate'
]
if
match
:
import
re
scheme
,
realm
=
match
.
groups
()
match
=
re
.
match
(
'[
\t
]*([^
\t
]+)[
\t
]+realm="([^"]*)"'
,
stuff
)
if
scheme
.
lower
()
==
'basic'
:
if
not
match
:
name
=
'retry_'
+
self
.
type
+
'_basic_auth'
URLopener
.
http_error_default
(
self
,
url
,
fp
,
if
data
is
None
:
errcode
,
errmsg
,
headers
)
return
getattr
(
self
,
name
)(
url
,
realm
)
scheme
,
realm
=
match
.
groups
()
else
:
if
scheme
.
lower
()
!=
'basic'
:
return
getattr
(
self
,
name
)(
url
,
realm
,
data
)
URLopener
.
http_error_default
(
self
,
url
,
fp
,
errcode
,
errmsg
,
headers
)
name
=
'retry_'
+
self
.
type
+
'_basic_auth'
if
data
is
None
:
return
getattr
(
self
,
name
)(
url
,
realm
)
else
:
return
getattr
(
self
,
name
)(
url
,
realm
,
data
)
def
retry_http_basic_auth
(
self
,
url
,
realm
,
data
=
None
):
def
retry_http_basic_auth
(
self
,
url
,
realm
,
data
=
None
):
host
,
selector
=
splithost
(
url
)
host
,
selector
=
splithost
(
url
)
...
...
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