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
c4ae86e4
Kaydet (Commit)
c4ae86e4
authored
May 23, 2015
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge 3.3 (#22931)
üst
7bf0d5a7
d504f20e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
cookies.py
Lib/http/cookies.py
+4
-3
test_http_cookies.py
Lib/test/test_http_cookies.py
+13
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/http/cookies.py
Dosyayı görüntüle @
c4ae86e4
...
...
@@ -428,12 +428,13 @@ class Morsel(dict):
# result, the parsing rules here are less strict.
#
_LegalCharsPatt
=
r"[\w\d!#
%
&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=]"
_LegalKeyChars
=
r"\w\d!#
%
&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\="
_LegalValueChars
=
_LegalKeyChars
+
'
\
[
\
]'
_CookiePattern
=
re
.
compile
(
r"""
(?x) # This is a verbose pattern
\s* # Optional whitespace at start of cookie
(?P<key> # Start of group 'key'
"""
+
_LegalCharsPatt
+
r"""
+? # Any word of at least one letter
["""
+
_LegalKeyChars
+
r"""]
+? # Any word of at least one letter
) # End of group 'key'
( # Optional group: there may not be a value.
\s*=\s* # Equal Sign
...
...
@@ -442,7 +443,7 @@ _CookiePattern = re.compile(r"""
| # or
\w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT # Special case for "expires" attr
| # or
"""
+
_LegalCharsPatt
+
r"""
* # Any word or empty string
["""
+
_LegalValueChars
+
r"""]
* # Any word or empty string
) # End of group 'val'
)? # End of optional value group
\s* # Any number of spaces.
...
...
Lib/test/test_http_cookies.py
Dosyayı görüntüle @
c4ae86e4
...
...
@@ -43,6 +43,19 @@ class CookieTests(unittest.TestCase):
'repr'
:
"<SimpleCookie: key:term='value:term'>"
,
'output'
:
'Set-Cookie: key:term=value:term'
},
# issue22931 - Adding '[' and ']' as valid characters in cookie
# values as defined in RFC 6265
{
'data'
:
'a=b; c=[; d=r; f=h'
,
'dict'
:
{
'a'
:
'b'
,
'c'
:
'['
,
'd'
:
'r'
,
'f'
:
'h'
},
'repr'
:
"<SimpleCookie: a='b' c='[' d='r' f='h'>"
,
'output'
:
'
\n
'
.
join
((
'Set-Cookie: a=b'
,
'Set-Cookie: c=['
,
'Set-Cookie: d=r'
,
'Set-Cookie: f=h'
))
}
]
for
case
in
cases
:
...
...
Misc/NEWS
Dosyayı görüntüle @
c4ae86e4
...
...
@@ -80,6 +80,8 @@ Library
- Issue #23796: peek and read1 methods of BufferedReader now raise ValueError
if they called on a closed object. Patch by John Hergenroeder.
- Issue #22931: Allow '
[
' and '
]
' in cookie values.
- Issue #24094: Fix possible crash in json.encode with poorly behaved dict
subclasses.
...
...
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