mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #4714] [MERGED] sec: Allow setting CORS origin #21543
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/4714
Author: @crizCraig
Created: 8/18/2024
Status: ✅ Merged
Merged: 8/19/2024
Merged by: @tjbck
Base:
dev← Head:set-cors📝 Commits (4)
d2f10d5Allow seting CORS origin7bcdc10Optimize imports845628cFix tab format causing build failure0550d12Black format📊 Changes
9 files changed (+52 additions, -21 deletions)
View changed files
📝
backend/apps/audio/main.py(+2 -1)📝
backend/apps/images/main.py(+2 -7)📝
backend/apps/ollama/main.py(+2 -1)📝
backend/apps/openai/main.py(+2 -1)📝
backend/apps/rag/main.py(+2 -4)📝
backend/apps/webui/main.py(+2 -3)📝
backend/config.py(+37 -0)📝
backend/main.py(+2 -3)📝
src/lib/i18n/locales/ru-RU/translation.json(+1 -1)📄 Description
Changelog Entry
Description
Added
Changed
The default value is still
["*"]so current users should be unaffectedSecurity
.envfor production deploymentsHow it was tested
CORS_ALLOW_ORIGINhttp://localhost:5173,http://localhost:8080notavalidurlapps/images,apps/audio,apps/openai, andmain.pyinbackendapps/ollama,apps/rag, orapps/webuias I'm not sure how to trigger those, but the change is identical to the other apps. The middleware is configured on import here, but not exercised in manual tests like the aboveScreenshots or Videos
Additional notes
I'll add documentation about the env var in the deploy section
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.