From 911c99f125b5e92a7e5bc9e36e185f473af07645 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Fri, 7 Oct 2022 03:23:16 +1300 Subject: [PATCH] Fix WebUI CORS Issue --- backend/invoke_ai_web_server.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/backend/invoke_ai_web_server.py b/backend/invoke_ai_web_server.py index 11a3c1b2b0..dced69f72f 100644 --- a/backend/invoke_ai_web_server.py +++ b/backend/invoke_ai_web_server.py @@ -53,17 +53,14 @@ class InvokeAIWebServer: cors_allowed_origins = [ 'http://127.0.0.1:5173', 'http://localhost:5173', + 'http://localhost:9090' ] additional_allowed_origins = ( opt.cors if opt.cors else [] ) # additional CORS allowed origins - if self.host == '127.0.0.1': - cors_allowed_origins.extend( - [ - f'http://{self.host}:{self.port}', - f'http://localhost:{self.port}', - ] - ) + cors_allowed_origins.append(f'http://{self.host}:{self.port}') + if self.host == '127.0.0.1' or self.host == '0.0.0.0': + cors_allowed_origins.append(f'http://localhost:{self.port}') cors_allowed_origins = ( cors_allowed_origins + additional_allowed_origins )