Skip to content
This repository has been archived by the owner on May 22, 2022. It is now read-only.

Commit

Permalink
Allow per-method OPTIONS overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
kemitche committed Apr 13, 2015
1 parent 9cd3b9c commit bf7abcb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions r2/r2/lib/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ def __call__(self, environ, start_response):
if meth == 'HEAD':
meth = 'GET'

if meth != 'OPTIONS':
handler_name = meth + '_' + action
else:
if (meth == 'OPTIONS' and
self._get_action_handler(action, meth) is None):
handler_name = meth
else:
handler_name = meth + '_' + action

request.environ['pylons.routes_dict']['action_name'] = action
request.environ['pylons.routes_dict']['action'] = handler_name
Expand Down

0 comments on commit bf7abcb

Please sign in to comment.