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
5a694200
Kaydet (Commit)
5a694200
authored
May 23, 2015
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge 3.4 (#22931)
üst
a48db2bc
c4ae86e4
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 @
5a694200
...
...
@@ -455,12 +455,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
...
...
@@ -469,7 +470,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 @
5a694200
...
...
@@ -44,6 +44,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 @
5a694200
...
...
@@ -325,6 +325,8 @@ Library
lines
from
the
code
object
,
fixing
an
issue
when
a
lambda
function
is
used
as
decorator
argument
.
Patch
by
Thomas
Ballinger
and
Allison
Kaptur
.
-
Issue
#
22931
:
Allow
'['
and
']'
in
cookie
values
.
-
The
keywords
attribute
of
functools
.
partial
is
now
always
a
dictionary
.
-
Issue
#
23811
:
Add
missing
newline
to
the
PyCompileError
error
message
.
...
...
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