开发者

ignoring parameter in cherrypy request

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜