From 2ccfb35ff2604b35956a62c54bef23e5dac403f5 Mon Sep 17 00:00:00 2001 From: Aaron Raddon Date: Tue, 22 Dec 2009 10:40:59 -0800 Subject: [PATCH] adding support for http method OPTIONS used by firefox, safari, for cross domain Closes #46. --- tornado/web.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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. -- 2.47.2