[PR #125] [CLOSED] refactor: Extract CORS middleware setup to a reusable function #181

Closed
opened 2026-10-18 21:12:29 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/mcpo/pull/125
Author: @MartinPSDev
Created: 5/9/2025
Status: ❌ Closed

Base: dev ← Head: fix/error-handling-enhancement


📝 Commits (4)

  • e37d0eb Merge pull request #108 from open-webui/dev
  • b978f2a refactor: Extract CORS middleware setup to a reusable function
  • b585455 docs: update CHANGELOG.md with CORS middleware refactor
  • 759775a refactor: Add get_optional_attr helper function for consistent attribute access

📊 Changes

2 files changed (+26 additions, -27 deletions)

View changed files

📝 CHANGELOG.md (+4 -5)
📝 src/mcpo/main.py (+22 -22)

📄 Description

Pull Request Description

This PR refactors the CORS middleware setup into a reusable function to reduce code duplication and improve maintainability.

Changes Made

  • Added setup_cors_middleware helper function to configure CORS middleware consistently
  • Replaced duplicate CORS middleware setup code with calls to the new function
  • Updated CHANGELOG.md to document the refactoring

Testing

  • All existing tests pass successfully
  • No functional changes, purely a code organization improvement

Checklist

  • Code follows project style guidelines
  • Tests pass successfully
  • CHANGELOG.md has been updated
  • Documentation has been updated (if applicable)

🔄 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/mcpo/pull/125 **Author:** [@MartinPSDev](https://github.com/MartinPSDev) **Created:** 5/9/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/error-handling-enhancement` --- ### 📝 Commits (4) - [`e37d0eb`](https://github.com/open-webui/mcpo/commit/e37d0ebd27934378364f534bd8ee6ae82a370536) Merge pull request #108 from open-webui/dev - [`b978f2a`](https://github.com/open-webui/mcpo/commit/b978f2aa15fdcef499f6d00a3ed9b4272b160741) refactor: Extract CORS middleware setup to a reusable function - [`b585455`](https://github.com/open-webui/mcpo/commit/b585455f8fd804ef1650310b7f973ace3462f093) docs: update CHANGELOG.md with CORS middleware refactor - [`759775a`](https://github.com/open-webui/mcpo/commit/759775afb9daaa35a817efcfc2ed64bca0730dbe) refactor: Add get_optional_attr helper function for consistent attribute access ### 📊 Changes **2 files changed** (+26 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+4 -5) 📝 `src/mcpo/main.py` (+22 -22) </details> ### 📄 Description # Pull Request Description This PR refactors the CORS middleware setup into a reusable function to reduce code duplication and improve maintainability. ### Changes Made - Added `setup_cors_middleware` helper function to configure CORS middleware consistently - Replaced duplicate CORS middleware setup code with calls to the new function - Updated CHANGELOG.md to document the refactoring ### Testing - All existing tests pass successfully - No functional changes, purely a code organization improvement ### Checklist - [x] Code follows project style guidelines - [x] Tests pass successfully - [x] CHANGELOG.md has been updated - [x] Documentation has been updated (if applicable) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-18 21:12:29 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/mcpo#181
No description provided.