From: Aaron Raddon Date: Tue, 22 Dec 2009 18:40:59 +0000 (-0800) Subject: adding support for http method OPTIONS used by firefox, safari, for cross domain X-Git-Tag: v1.1.0~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ccfb35ff2604b35956a62c54bef23e5dac403f5;p=thirdparty%2Ftornado.git adding support for http method OPTIONS used by firefox, safari, for cross domain Closes #46. --- diff --git a/tornado/web.py b/tornado/web.py index a8e1b6c7e..ac2fd0edf 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -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.