ashleysommer / sanic-cors

A Sanic extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible. Based on flask-cors by Cory Dolphin.
MIT License
160 stars 22 forks source link

Fix support for latest sanic #20

Closed aveao closed 6 years ago

aveao commented 6 years ago

Due to the change on https://github.com/channelcat/sanic/commit/334649dfd4e9b16cbcadcc6264ac9dee6ab7baf3#diff-bd84a6e523017a7f3d6bd72ee689dce2L42, sanic-cors is broken.

The fix is as simple as try-excepting the imports so that the right thing can be imported, which is exactly what this PR does.

All credit of this PR goes to @lnmds, as she was the one to write the fix. I'm just submitting this on her behalf as she's busy.

c-goosen commented 6 years ago

Thanks for this @aveao!

ashleysommer commented 6 years ago

Thanks. Merged. I will probably make a release with this change in the next few days.