Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
f9058baa
Commit
f9058baa
authored
Jul 01, 2007
by
Lennart Regebro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collector #2153: Supporting unquoted cookies with spaces.
parent
d7744844
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
doc/CHANGES.txt
doc/CHANGES.txt
+2
-0
lib/python/ZPublisher/HTTPRequest.py
lib/python/ZPublisher/HTTPRequest.py
+1
-1
lib/python/ZPublisher/tests/testHTTPRequest.py
lib/python/ZPublisher/tests/testHTTPRequest.py
+14
-0
No files found.
doc/CHANGES.txt
View file @
f9058baa
...
...
@@ -8,6 +8,8 @@ Zope Changes
Bugs fixed
- Collector #2153: Supporting unquoted cookies with spaces.
- The REQUEST no longer accepts holds after it has been closed.
- Collector #1441: WebDAV compatibility with Windows Web Folders
...
...
lib/python/ZPublisher/HTTPRequest.py
View file @
f9058baa
...
...
@@ -1471,7 +1471,7 @@ def parse_cookie(text,
qparmre
=
re
.
compile
(
'([
\
x00
- ]*([^
\
x00
- ;,="]+)="([^"]*)"([
\
x00
- ]*[;,])?[
\
x00
- ]*)'
),
parmre
=
re
.
compile
(
'([
\
x00
- ]*([^
\
x00
- ;,="]+)=([^
\
x00
-
;,"]*)([
\
x00
- ]*[;,])?[
\
x00
- ]*)'
),
'([
\
x00
- ]*([^
\
x00
- ;,="]+)=([^;,"]*)([
\
x00
- ]*[;,])?[
\
x00
- ]*)'
),
paramlessre
=
re
.
compile
(
'([
\
x00
- ]*([^
\
x00
- ;,="]+)[
\
x00
- ]*[;,][
\
x00
- ]*)'
),
...
...
lib/python/ZPublisher/tests/testHTTPRequest.py
View file @
f9058baa
...
...
@@ -649,6 +649,20 @@ class ProcessInputsTests(unittest.TestCase):
self
.
assertEquals
(
req
.
cookies
[
'hmm'
],
''
)
self
.
assertEquals
(
req
.
cookies
[
'baz'
],
'gee'
)
# Unquoted multi-space cookies
env
[
'HTTP_COOKIE'
]
=
'single=cookie data; '
\
'quoted="cookie data with unquoted spaces"; '
\
'multi=cookie data with unquoted spaces; '
\
'multi2=cookie data with unquoted spaces'
req
=
self
.
_getHTTPRequest
(
env
)
self
.
assertEquals
(
req
.
cookies
[
'single'
],
'cookie data'
)
self
.
assertEquals
(
req
.
cookies
[
'quoted'
],
'cookie data with unquoted spaces'
)
self
.
assertEquals
(
req
.
cookies
[
'multi'
],
'cookie data with unquoted spaces'
)
self
.
assertEquals
(
req
.
cookies
[
'multi2'
],
'cookie data with unquoted spaces'
)
TEST_ENVIRON
=
{
'CONTENT_TYPE'
:
'multipart/form-data; boundary=12345'
,
'REQUEST_METHOD'
:
'POST'
,
...
...
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