mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fix WebUI CORS Issue
This commit is contained in:
parent
7a0d4c3350
commit
c7ccb9dacd
@ -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
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user