Enable 'OPTIONS' method for simple_server.

You still need to set the config option to allow the method but
if it is enabled then Quixote will allow it.  Implementation of
the method is up to the application, not Quixote.
This commit is contained in:
Neil Schemenauer 2016-10-17 13:57:38 -07:00
parent 056e066524
commit b607a2b9af
1 changed files with 3 additions and 0 deletions

View File

@ -109,6 +109,9 @@ class HTTPRequestHandler(BaseHTTPRequestHandler):
def do_HEAD(self):
return self.process(self.get_cgi_env('HEAD'), include_body=False)
def do_OPTIONS(self):
return self.process(self.get_cgi_env('OPTIONS'), include_body=False)
def send_response(self, code, message=None):
"""
Copied, with regret, from BaseHTTPRequestHandler, except that the line