Skip to content

Commit

Permalink
support OPTIONS request method in aiohttp and sanic
Browse files Browse the repository at this point in the history
Fixes #70
  • Loading branch information
miguelgrinberg committed May 11, 2018
1 parent 8f3d6ec commit 2bb769e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions engineio/async_aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def create_route(app, engineio_server, engineio_endpoint):
"""
app.router.add_get(engineio_endpoint, engineio_server.handle_request)
app.router.add_post(engineio_endpoint, engineio_server.handle_request)
app.router.add_route('OPTIONS', engineio_endpoint,
engineio_server.handle_request)


def translate_request(request):
Expand Down
2 changes: 1 addition & 1 deletion engineio/async_sanic.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def create_route(app, engineio_server, engineio_endpoint):
endpoint.
"""
app.add_route(engineio_server.handle_request, engineio_endpoint,
methods=['GET', 'POST'])
methods=['GET', 'POST', 'OPTIONS'])
try:
app.enable_websocket()
except AttributeError:
Expand Down

0 comments on commit 2bb769e

Please sign in to comment.