Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
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
django
Commits
f2a44528
Kaydet (Commit)
f2a44528
authored
Eyl 09, 2013
tarafından
e0ne
Kaydeden (comit)
Tim Graham
Eyl 10, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #18403 -- Initialized bad_cookies in SimpleCookie
Thanks Stefano Crosta for the report.
üst
7008ed61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
cookie.py
django/http/cookie.py
+2
-0
tests.py
tests/httpwrappers/tests.py
+9
-0
No files found.
django/http/cookie.py
Dosyayı görüntüle @
f2a44528
...
...
@@ -64,6 +64,8 @@ else:
M
.
set
(
key
,
real_value
,
coded_value
)
dict
.
__setitem__
(
self
,
key
,
M
)
except
http_cookies
.
CookieError
:
if
not
hasattr
(
self
,
'bad_cookies'
):
self
.
bad_cookies
=
set
()
self
.
bad_cookies
.
add
(
key
)
dict
.
__setitem__
(
self
,
key
,
http_cookies
.
Morsel
())
...
...
tests/httpwrappers/tests.py
Dosyayı görüntüle @
f2a44528
...
...
@@ -618,3 +618,12 @@ class CookieTests(unittest.TestCase):
c
=
SimpleCookie
()
c
.
load
({
'name'
:
'val'
})
self
.
assertEqual
(
c
[
'name'
]
.
value
,
'val'
)
@unittest.skipUnless
(
six
.
PY2
,
"PY3 throws an exception on invalid cookie keys."
)
def
test_bad_cookie
(
self
):
"""
Regression test for #18403
"""
r
=
HttpResponse
()
r
.
set_cookie
(
"a:.b/"
,
1
)
self
.
assertEqual
(
len
(
r
.
cookies
.
bad_cookies
),
1
)
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