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
7877a761
Kaydet (Commit)
7877a761
authored
Ara 29, 2002
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #655760: add warnings when the unsafe *Cookie classes are instantiated
üst
ea3fdf44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
Cookie.py
Lib/Cookie.py
+11
-1
No files found.
Lib/Cookie.py
Dosyayı görüntüle @
7877a761
...
@@ -222,7 +222,7 @@ try:
...
@@ -222,7 +222,7 @@ try:
except
ImportError
:
except
ImportError
:
from
pickle
import
dumps
,
loads
from
pickle
import
dumps
,
loads
import
re
import
re
,
warnings
__all__
=
[
"CookieError"
,
"BaseCookie"
,
"SimpleCookie"
,
"SerialCookie"
,
__all__
=
[
"CookieError"
,
"BaseCookie"
,
"SimpleCookie"
,
"SerialCookie"
,
"SmartCookie"
,
"Cookie"
]
"SmartCookie"
,
"Cookie"
]
...
@@ -682,6 +682,11 @@ class SerialCookie(BaseCookie):
...
@@ -682,6 +682,11 @@ class SerialCookie(BaseCookie):
Note: HTTP has a 2k limit on the size of a cookie. This class
Note: HTTP has a 2k limit on the size of a cookie. This class
does not check for this limit, so be careful!!!
does not check for this limit, so be careful!!!
"""
"""
def
__init__
(
self
,
input
=
None
):
warnings
.
warn
(
"SerialCookie class is insecure; do not use it"
,
DeprecationWarning
)
BaseCookie
.
__init__
(
self
,
input
)
# end __init__
def
value_decode
(
self
,
val
):
def
value_decode
(
self
,
val
):
# This could raise an exception!
# This could raise an exception!
return
loads
(
_unquote
(
val
)
),
val
return
loads
(
_unquote
(
val
)
),
val
...
@@ -702,6 +707,11 @@ class SmartCookie(BaseCookie):
...
@@ -702,6 +707,11 @@ class SmartCookie(BaseCookie):
Note: HTTP has a 2k limit on the size of a cookie. This class
Note: HTTP has a 2k limit on the size of a cookie. This class
does not check for this limit, so be careful!!!
does not check for this limit, so be careful!!!
"""
"""
def
__init__
(
self
,
input
=
None
):
warnings
.
warn
(
"Cookie/SmartCookie class is insecure; do not use it"
,
DeprecationWarning
)
BaseCookie
.
__init__
(
self
,
input
)
# end __init__
def
value_decode
(
self
,
val
):
def
value_decode
(
self
,
val
):
strval
=
_unquote
(
val
)
strval
=
_unquote
(
val
)
try
:
try
:
...
...
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