Skip to content

Commit

Permalink
remove fallback arg from error handler. fixes #57
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleysommer committed Jan 28, 2022
1 parent a8d4fb1 commit 618a0dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Change Log
## 2.0.1
- Fix constructor of CORSErrorHandler, to remove 22.6 deprecation warning. Fixes #57

## 2.0.0
- Big changes for Sanic v21.12.0
- Remove the use of Sanic-Plugin-Toolkit.
Expand Down
6 changes: 3 additions & 3 deletions sanic_cors/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def init_app(self, context, *args, **kwargs):
_make_cors_response_middleware_function(app, context=context)
else:
if hasattr(app, "error_handler"):
cors_error_handler = CORSErrorHandler(context, app.error_handler, fallback="auto")
cors_error_handler = CORSErrorHandler(context, app.error_handler)
setattr(app, "error_handler", cors_error_handler)
app.listener("before_server_start")(self.on_before_server_start)

Expand Down Expand Up @@ -402,8 +402,8 @@ def __new__(cls, *args, **kwargs):
self.response = self.sync_response
return self

def __init__(self, context, orig_handler, fallback="auto"):
super(CORSErrorHandler, self).__init__(fallback=fallback)
def __init__(self, context, orig_handler):
super(CORSErrorHandler, self).__init__()
self.orig_handler = orig_handler
self.ctx = context

Expand Down
2 changes: 1 addition & 1 deletion sanic_cors/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.0.0'
__version__ = '2.0.1'

0 comments on commit 618a0dd

Please sign in to comment.