mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Allow multiple CORS origins (#2031)
* Permit cmd override for CORS modification * Enable multiple origins for CORS * Remove CMD_OVERRIDE * Revert executable bit change * Defensively convert list into string * Bad if statement * Retry rebase * Retry rebase Co-authored-by: Chris Dawson <chris@vivoh.com>
This commit is contained in:
parent
5d69bd408b
commit
91eb84c5d9
@ -85,7 +85,14 @@ class InvokeAIWebServer:
|
||||
}
|
||||
|
||||
if opt.cors:
|
||||
socketio_args["cors_allowed_origins"] = opt.cors
|
||||
_cors = opt.cors
|
||||
# convert list back into comma-separated string,
|
||||
# be defensive here, not sure in what form this arrives
|
||||
if isinstance(_cors, list):
|
||||
_cors = ",".join(_cors)
|
||||
if "," in _cors:
|
||||
_cors = _cors.split(",")
|
||||
socketio_args["cors_allowed_origins"] = _cors
|
||||
|
||||
frontend_path = self.find_frontend()
|
||||
self.app = Flask(
|
||||
|
Loading…
Reference in New Issue
Block a user