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
b592d3ef
Commit
b592d3ef
authored
Jul 14, 2010
by
Jens Vagelpohl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- LP #143564: Request.resolve_url did not correctly re-raise
exceptions encountered during path traversal.
parent
366aee21
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
doc/CHANGES.rst
doc/CHANGES.rst
+3
-0
src/ZPublisher/HTTPRequest.py
src/ZPublisher/HTTPRequest.py
+1
-1
src/ZPublisher/tests/testHTTPRequest.py
src/ZPublisher/tests/testHTTPRequest.py
+19
-0
No files found.
doc/CHANGES.rst
View file @
b592d3ef
...
@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/.
...
@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/.
Bugs Fixed
Bugs Fixed
++++++++++
++++++++++
- LP #143564: Request.resolve_url did not correctly re-raise
exceptions encountered during path traversal.
- LP #143273: Enable the dtml-var modifiers url_quote, url_unquote,
- LP #143273: Enable the dtml-var modifiers url_quote, url_unquote,
url_quote_plus and url_unquote_plus to handle unicode strings.
url_quote_plus and url_unquote_plus to handle unicode strings.
...
...
src/ZPublisher/HTTPRequest.py
View file @
b592d3ef
...
@@ -1178,7 +1178,7 @@ class HTTPRequest(BaseRequest):
...
@@ -1178,7 +1178,7 @@ class HTTPRequest(BaseRequest):
rsp
.
exception
()
rsp
.
exception
()
if
object
is
None
:
if
object
is
None
:
req
.
clear
()
req
.
clear
()
raise
rsp
.
errmsg
,
sys
.
exc_info
()[
1
]
raise
sys
.
exc_info
()[
0
],
rsp
.
errmsg
# The traversal machinery may return a "default object"
# The traversal machinery may return a "default object"
# like an index_html document. This is not appropriate
# like an index_html document. This is not appropriate
...
...
src/ZPublisher/tests/testHTTPRequest.py
View file @
b592d3ef
...
@@ -19,6 +19,7 @@ class HTTPRequestTests(unittest.TestCase):
...
@@ -19,6 +19,7 @@ class HTTPRequestTests(unittest.TestCase):
def
_makeOne
(
self
,
stdin
=
None
,
environ
=
None
,
response
=
None
,
clean
=
1
):
def
_makeOne
(
self
,
stdin
=
None
,
environ
=
None
,
response
=
None
,
clean
=
1
):
from
StringIO
import
StringIO
from
StringIO
import
StringIO
from
ZPublisher
import
NotFound
if
stdin
is
None
:
if
stdin
is
None
:
stdin
=
StringIO
()
stdin
=
StringIO
()
...
@@ -37,6 +38,14 @@ class HTTPRequestTests(unittest.TestCase):
...
@@ -37,6 +38,14 @@ class HTTPRequestTests(unittest.TestCase):
if
response
is
None
:
if
response
is
None
:
class
_FauxResponse
(
object
):
class
_FauxResponse
(
object
):
_auth
=
None
_auth
=
None
debug_mode
=
False
errmsg
=
'OK'
def
notFoundError
(
self
,
message
):
raise
NotFound
,
message
def
exception
(
self
,
*
args
,
**
kw
):
pass
response
=
_FauxResponse
()
response
=
_FauxResponse
()
...
@@ -995,6 +1004,16 @@ class HTTPRequestTests(unittest.TestCase):
...
@@ -995,6 +1004,16 @@ class HTTPRequestTests(unittest.TestCase):
self
.
failIf
(
len
(
events
),
self
.
failIf
(
len
(
events
),
"HTTPRequest.resolve_url should not emit events"
)
"HTTPRequest.resolve_url should not emit events"
)
def
test_resolve_url_errorhandling
(
self
):
# Check that resolve_url really raises the same error
# it received from ZPublisher.BaseRequest.traverse
from
zExceptions
import
NotFound
request
=
self
.
_makeOne
()
request
[
'PARENTS'
]
=
[
object
()]
self
.
assertRaises
(
NotFound
,
request
.
resolve_url
,
request
.
script
+
'/does_not_exist'
)
def
test_parses_json_cookies
(
self
):
def
test_parses_json_cookies
(
self
):
# https://bugs.launchpad.net/zope2/+bug/563229
# https://bugs.launchpad.net/zope2/+bug/563229
...
...
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