开发者

ignoring parameter in cherrypy request

开发者 https://www.devze.com 2023-03-13 10:04 出处:网络
I\'m trying to make a token double submit mechanism for my cherrypy website. The client side rpc always includes a \"_token\" parameter in开发者_开发问答 request. I would prefer not to add \"_token\"

I'm trying to make a token double submit mechanism for my cherrypy website.

The client side rpc always includes a "_token" parameter in开发者_开发问答 request. I would prefer not to add "_token" as a parameter to every request handling function i write. I just want to check cherrypy.request.params["_token"] in an "on_start_resource" Tool i've added.


Have your on_start_resource Tool delete "_token" from the cherrypy.request.params dict when it's done with it. cf http://docs.python.org/library/stdtypes.html#dict.pop

0

精彩评论

暂无评论...
验证码 换一张
取 消