bazarr
bazarr copied to clipboard
WIP / RFC: Enable CORS headers
As discussed with @morpheus65535 over Discord. Currently this is preliminary PR and RFC for enabling / disabling CORS headers.
This allows browsers to execute cross-domain traffic between their 'domain' (ie. domain1.tld) and the 'domain' Bazarr is running on (192.168.1.1)
When the setting is enabled it will set the HTTP header Access-Control-Allow-Origin
to *
(IE, everyone). By default the setting this is disabled.
More background information on CORS headers: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
This PR is currently in draft because I need to finish up on the testing.
Looks good but don't add flask-cors to requireents.txt unless it require compiling on client computer. If it's pure python, vendor it in libs directory and make sure to add it to version.txt.
Looks good but don't add flask-cors to requireents.txt unless it require compiling on client computer. If it's pure python, vendor it in libs directory and make sure to add it to version.txt.
Thanks for your preliminary. I will change this and then continue onward with the testing :smile:
@morpheus65535 I've started to continue working on this PR. But I had one question, how do I vendor the flash-cors
dependency?
@morpheus65535 I've started to continue working on this PR. But I had one question, how do I vendor the
flash-cors
dependency?
Sorry for the delay, I was on vacation.
You can simply put that directory (https://github.com/corydolphin/flask-cors/tree/master/flask_cors) inside libs
directory.
This will enable cors only at restart, simple enable setting will do nothing. I will add some note about that fact
@morpheus65535 I've started to continue working on this PR. But I had one question, how do I vendor the
flash-cors
dependency?Sorry for the delay, I was on vacation.
You can simply put that directory (https://github.com/corydolphin/flask-cors/tree/master/flask_cors) inside
libs
directory.
@morpheus65535 I hope you enjoyed your holiday! Thanks for your reply, I will do that.
This will enable cors only at restart, simple enable setting will do nothing. I will add some note about that fact
@halali I also made a mention of that in the UI. Source: https://github.com/morpheus65535/bazarr/pull/1868/files#diff-2e987b2ddc76e1053aaf36788a3f14d4dbf315110727e2daf358de9a45a06315R125
@morpheus65535 I've started to continue working on this PR. But I had one question, how do I vendor the
flash-cors
dependency?Sorry for the delay, I was on vacation.
You can simply put that directory (https://github.com/corydolphin/flask-cors/tree/master/flask_cors) inside
libs
directory.@morpheus65535 I hope you enjoyed your holiday! Thanks for your reply, I will do that.
This will enable cors only at restart, simple enable setting will do nothing. I will add some note about that fact
@halali I also made a mention of that in the UI. Source: https://github.com/morpheus65535/bazarr/pull/1868/files#diff-2e987b2ddc76e1053aaf36788a3f14d4dbf315110727e2daf358de9a45a06315R125
Sorry, missed that
@morpheus65535 it's ready for review. Sorry for the delay, real life got in the way :)
I added one single comment. Other than that, it looks really good, thanks!
@morpheus65535 No problem! And thank you for the review :)