Skip to content

Commit

Permalink
typo in last commit
Browse files Browse the repository at this point in the history
Update readme to reflect changes to automatic_options
  • Loading branch information
ashleysommer committed Feb 25, 2020
1 parent cff1fb8 commit dbb65f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ via the options method, Sanic by default only allows the ``GET`` method, in orde
service your CORS requests you must specify ``OPTIONS`` in the methods argument to
your routes decorator.

Alternately, you can use the ``automatic_options`` configuration parameter to
handle the ``OPTIONS`` response automatically for you.
Sanic-CORS includes an ``automatic_options`` configuration parameter to
allow the plugin handle the ``OPTIONS`` response automatically for you. This is enabled by default, but you
can turn it off if you wish to do your own ``OPTIONS`` response.

.. code:: python
Expand Down
2 changes: 1 addition & 1 deletion sanic_cors/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def unapplied_cors_request_middleware(req, context):
"context. Has request started? Is request ended?")
set_cors_headers(req, resp, request_context, res_options)
if request_context is not None:
setattr(req.ctx, SANIC_CORS_EVALUATED, "1")
setattr(request_context, SANIC_CORS_EVALUATED, "1")
return resp
else:
debug('No CORS rule matches')
Expand Down

0 comments on commit dbb65f0

Please sign in to comment.