Skip to content
Browse files

Fix options

  • Loading branch information...
1 parent f488dfc commit db87820664a592012ef216be3ba1af28dde9e4a2 @klen committed Nov 19, 2012
Showing with 6 additions and 0 deletions.
  1. +3 −0 adrest/resources/rpc.py
  2. +3 −0 tests/rpc/tests.py
View
3 adrest/resources/rpc.py
@@ -39,6 +39,9 @@ def configure_rpc(self, scheme):
self.methods[m.__name__] = m
def handle_request(self, request, **resources):
+ if request.method == 'OPTIONS':
+ return super(RPCResource, self).handle_request(request, **resources)
+
payload = request.data
try:
View
3 tests/rpc/tests.py
@@ -20,6 +20,9 @@ def setUp(self):
def test_base_rpc(self):
+ response = self.get_resource('rpc2', method='options')
+ self.assertEqual(response.content, 'OK')
+
# POST args
response = self.rpc(
'rpc2',

0 comments on commit db87820

Please sign in to comment.
Something went wrong with that request. Please try again.