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
6a4af612
Commit
6a4af612
authored
Jun 18, 2015
by
Tres Seaver
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #29 from zopefoundation/lp1465432-backport_end_interaction
WSGI begin / end interaction fixes
parents
857907e8
bce98ad9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
39 deletions
+52
-39
doc/CHANGES.rst
doc/CHANGES.rst
+8
-0
src/ZPublisher/WSGIPublisher.py
src/ZPublisher/WSGIPublisher.py
+44
-39
No files found.
doc/CHANGES.rst
View file @
6a4af612
...
@@ -8,6 +8,9 @@ http://docs.zope.org/zope2/
...
@@ -8,6 +8,9 @@ http://docs.zope.org/zope2/
2.13.23 (unreleased)
2.13.23 (unreleased)
--------------------
--------------------
- LP #1465432: Ensure that WSGIPublisher starts / ends interaction at
request boundaries (analogous to ZPublisher). Backport from master.
- Fix: Queue additional warning filters at the beginning of the queue in order
- Fix: Queue additional warning filters at the beginning of the queue in order
to allow overrides.
to allow overrides.
...
@@ -181,6 +184,11 @@ http://docs.zope.org/zope2/
...
@@ -181,6 +184,11 @@ http://docs.zope.org/zope2/
Ported the ``shiftNameToApplication`` implementation from zope.publisher to
Ported the ``shiftNameToApplication`` implementation from zope.publisher to
ZPublisher.HTTPRequest.HTTPRequest.
ZPublisher.HTTPRequest.HTTPRequest.
- Ensure that the ``WSGIPublisher`` begins and ends an *interaction*
at the request/response barrier. This is required for instance for
the ``checkPermission`` call to function without an explicit
``interaction`` parameter.
- Ensure that ObjectManager's ``get`` and ``__getitem__`` methods return only
- Ensure that ObjectManager's ``get`` and ``__getitem__`` methods return only
"items" (no attributes / methods from the class or from acquisition).
"items" (no attributes / methods from the class or from acquisition).
Thanks to Richard Mitchell at Netsight for the report.
Thanks to Richard Mitchell at Netsight for the report.
...
...
src/ZPublisher/WSGIPublisher.py
View file @
6a4af612
...
@@ -19,6 +19,7 @@ import transaction
...
@@ -19,6 +19,7 @@ import transaction
from
zExceptions
import
Redirect
from
zExceptions
import
Redirect
from
zExceptions
import
Unauthorized
from
zExceptions
import
Unauthorized
from
zope.event
import
notify
from
zope.event
import
notify
from
zope.security.management
import
newInteraction
,
endInteraction
from
zope.publisher.skinnable
import
setDefaultSkin
from
zope.publisher.skinnable
import
setDefaultSkin
from
ZServer.medusa.http_date
import
build_http_date
from
ZServer.medusa.http_date
import
build_http_date
...
@@ -165,45 +166,49 @@ def publish(request, module_name,
...
@@ -165,45 +166,49 @@ def publish(request, module_name,
)
=
_get_module_info
(
module_name
)
)
=
_get_module_info
(
module_name
)
notify
(
PubStart
(
request
))
notify
(
PubStart
(
request
))
request
.
processInputs
()
newInteraction
()
response
=
request
.
response
try
:
request
.
processInputs
()
if
bobo_after
is
not
None
:
response
=
request
.
response
response
.
after_list
+=
(
bobo_after
,)
if
bobo_after
is
not
None
:
if
debug_mode
:
response
.
after_list
+=
(
bobo_after
,)
response
.
debug_mode
=
debug_mode
if
debug_mode
:
if
realm
and
not
request
.
get
(
'REMOTE_USER'
,
None
):
response
.
debug_mode
=
debug_mode
response
.
realm
=
realm
if
realm
and
not
request
.
get
(
'REMOTE_USER'
,
None
):
if
bobo_before
is
not
None
:
response
.
realm
=
realm
bobo_before
()
if
bobo_before
is
not
None
:
# Get the path list.
bobo_before
()
# According to RFC1738 a trailing space in the path is valid.
path
=
request
.
get
(
'PATH_INFO'
)
# Get the path list.
# According to RFC1738 a trailing space in the path is valid.
request
[
'PARENTS'
]
=
[
object
]
path
=
request
.
get
(
'PATH_INFO'
)
object
=
request
.
traverse
(
path
,
validated_hook
=
validated_hook
)
notify
(
PubAfterTraversal
(
request
))
request
[
'PARENTS'
]
=
[
object
]
object
=
request
.
traverse
(
path
,
validated_hook
=
validated_hook
)
if
transactions_manager
:
notify
(
PubAfterTraversal
(
request
))
transactions_manager
.
recordMetaData
(
object
,
request
)
if
transactions_manager
:
result
=
mapply
(
object
,
transactions_manager
.
recordMetaData
(
object
,
request
)
request
.
args
,
request
,
result
=
mapply
(
object
,
call_object
,
request
.
args
,
1
,
request
,
missing_name
,
call_object
,
dont_publish_class
,
1
,
request
,
missing_name
,
bind
=
1
,
dont_publish_class
,
)
request
,
bind
=
1
,
if
result
is
not
response
:
)
response
.
setBody
(
result
)
if
result
is
not
response
:
response
.
setBody
(
result
)
finally
:
endInteraction
()
notify
(
PubBeforeCommit
(
request
))
notify
(
PubBeforeCommit
(
request
))
return
response
return
response
...
...
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