Just say yes to OPTIONS requests, since we want to turn on CORS headers for all paths

paul/schema_breaking_changes
Erik Johnston 2014-08-12 17:13:14 +01:00
parent f99168de06
commit 4add1c70e9
1 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,11 @@ class TwistedHttpServer(HttpServer, resource.Resource):
path. path.
""" """
try: try:
# Just say yes to OPTIONS.
if request.method == "OPTIONS":
self._send_response(request, 200, {})
return
# Loop through all the registered callbacks to check if the method # Loop through all the registered callbacks to check if the method
# and path regex match # and path regex match
for path_entry in self.path_regexs.get(request.method, []): for path_entry in self.path_regexs.get(request.method, []):