Before submitting, make sure you've checked the following:
Target branch: Please verify that the pull request targets the dev branch.
Description: Provide a concise description of the changes made in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Changelog Entry
Description
Fixed CORS issues with static files by implementing proper CORS headers handling for FastAPI's static file serving. This resolves the issue where static resources (like favicon.png) couldn't be accessed from different origins during development.
Added
Added CORSStaticFiles class to handle CORS headers for static file responses
Changed
Modified static file mounting to use CORSStaticFiles instead of default StaticFiles
Fixed
Fixed CORS error when accessing static files from different origins (e.g., localhost:5173 accessing resources from localhost:8080). Resolved "Access-Control-Allow-Origin header missing" error for static resources
Screenshots or Videos
Before:
After:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/7458
**Author:** [@juananpe](https://github.com/juananpe)
**Created:** 11/28/2024
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `devcors`
---
### 📝 Commits (1)
- [`34cafd8`](https://github.com/open-webui/open-webui/commit/34cafd8e223124eaee9ef30b4bea1c36ef2423cd) Feat: Enable CORS for static files
### 📊 Changes
**1 file changed** (+11 additions, -3 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/main.py` (+11 -3)
</details>
### 📄 Description
# Pull Request Checklist
**Before submitting, make sure you've checked the following:**
- [x] **Target branch:** Please verify that the pull request targets the `dev` branch.
- [x] **Description:** Provide a concise description of the changes made in this pull request.
- [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
# Changelog Entry
### Description
- Fixed CORS issues with static files by implementing proper CORS headers handling for FastAPI's static file serving. This resolves the issue where static resources (like favicon.png) couldn't be accessed from different origins during development.
### Added
- Added CORSStaticFiles class to handle CORS headers for static file responses
### Changed
- Modified static file mounting to use CORSStaticFiles instead of default StaticFiles
### Fixed
- Fixed CORS error when accessing static files from different origins (e.g., localhost:5173 accessing resources from localhost:8080). Resolved "Access-Control-Allow-Origin header missing" error for static resources
### Screenshots or Videos
Before:

After:

---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/7458
Author: @juananpe
Created: 11/28/2024
Status: ❌ Closed
Base:
dev← Head:devcors📝 Commits (1)
34cafd8Feat: Enable CORS for static files📊 Changes
1 file changed (+11 additions, -3 deletions)
View changed files
📝
backend/open_webui/main.py(+11 -3)📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Added
Changed
Fixed
Screenshots or Videos
Before:

After:

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.