]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
adding support for http method OPTIONS used by firefox, safari, for cross domain
authorAaron Raddon <araddon@yahoo.com>
Tue, 22 Dec 2009 18:40:59 +0000 (10:40 -0800)
committerBen Darnell <ben@bendarnell.com>
Thu, 26 Aug 2010 23:03:34 +0000 (16:03 -0700)
Closes #46.

tornado/web.py

index a8e1b6c7e1b432e85f90856b190bbbf64e88f49d..ac2fd0edf1c92659864ec9150a997634c6b2db5f 100644 (file)
@@ -83,7 +83,7 @@ class RequestHandler(object):
     should override the class variable SUPPORTED_METHODS in your
     RequestHandler class.
     """
-    SUPPORTED_METHODS = ("GET", "HEAD", "POST", "DELETE", "PUT")
+    SUPPORTED_METHODS = ("GET", "HEAD", "POST", "DELETE", "PUT", "OPTIONS")
 
     def __init__(self, application, request, **kwargs):
         self.application = application
@@ -142,6 +142,9 @@ class RequestHandler(object):
     def put(self, *args, **kwargs):
         raise HTTPError(405)
 
+    def options(self, *args, **kwargs):
+        raise HTTPError(405)
+
     def prepare(self):
         """Called before the actual handler method.