summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-12-17 01:00:57 -0500
committerJason R. Coombs <jaraco@jaraco.com>2017-12-17 01:01:50 -0500
commit8b0e8a0acb321a52dce7f6b2c81ef0193bce0449 (patch)
tree52dce7ecb507a048253b577fc55b6768211920d1
parent9a143b81c9b0a13274e8abb05445276f7189bfb5 (diff)
downloadcherrypy-git-use-assign-params.tar.gz
Use assign_params to assign the merged_args to the call to set_response_cookie. Allows merged args to include http_only parameter, which may have been an oversight.use-assign-params
-rw-r--r--cherrypy/_cptools.py12
-rwxr-xr-xsetup.py1
2 files changed, 5 insertions, 8 deletions
diff --git a/cherrypy/_cptools.py b/cherrypy/_cptools.py
index 92c2b656..26488751 100644
--- a/cherrypy/_cptools.py
+++ b/cherrypy/_cptools.py
@@ -25,6 +25,8 @@ are generally either modules or instances of the tools.Tool class.
import sys
import warnings
+from jaraco.functools import assign_params
+
import cherrypy
from cherrypy._helper import expose
@@ -321,14 +323,8 @@ class SessionTool(Tool):
sess = cherrypy.serving.session
sess.regenerate()
- # Grab cookie-relevant tool args
- relevant = 'path', 'path_header', 'name', 'timeout', 'domain', 'secure'
- conf = dict(
- (k, v)
- for k, v in self._merged_args().items()
- if k in relevant
- )
- _sessions.set_response_cookie(**conf)
+ # Set response cookie with relevant args
+ assign_params(_sessions.set_response_cookie, self._merged_args())()
class XMLRPCController(object):
diff --git a/setup.py b/setup.py
index df6630c7..5e51335d 100755
--- a/setup.py
+++ b/setup.py
@@ -58,6 +58,7 @@ install_requires = [
'cheroot>=5.9.1',
'portend>=2.1.1',
'jaraco.classes',
+ 'jaraco.functools',
]
extras_require = {