diff --git a/README.rst b/README.rst index 1363380..a5be9c7 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/sanic_cors/extension.py b/sanic_cors/extension.py index 732829f..f87f546 100644 --- a/sanic_cors/extension.py +++ b/sanic_cors/extension.py @@ -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')