mirror of
https://github.com/justlovemaki/AIClient-2-API.git
synced 2026-04-26 18:05:48 +03:00
[PR #141] [MERGED] fix: resolve CORS for browser extensions & enhance OpenAI Responses compatibility #273
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AIClient-2-API-justlovemaki#273
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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/justlovemaki/AIClient-2-API/pull/141
Author: @yicone
Created: 12/27/2025
Status: ✅ Merged
Merged: 12/27/2025
Merged by: @justlovemaki
Base:
main← Head:main📝 Commits (1)
7278293fix: resolve CORS for browser extensions & enhance OpenAI Responses compatibility📊 Changes
4 files changed (+188 additions, -8 deletions)
View changed files
📝
src/converters/strategies/OpenAIResponsesConverter.js(+12 -5)📝
src/request-handler.js(+5 -3)➕
tests/cors-config.test.js(+91 -0)➕
tests/openai-responses-converter.test.js(+80 -0)📄 Description
Description
This PR addresses two issues encountered when integrating with browser extensions (specifically Twemex):
chrome-extension://...). Previously, the preflightOPTIONScheck wasn't sufficient for all extension fetch requests.OpenAIResponsesConverterto handle input items that:typeproperty (defaulting to'message').contentinstead of an array of objects.Context
These issues were discovered while using the Twemex Chrome extension, which relies on the
/v1/responsesendpoint. The extension sends requests that were previously blocked by CORS and uses a simplified input format that the converter didn't handle.cc @JimmyLv (Twemex author) - FYI, this enables Twemex compatibility with this project.
Changes
src/request-handler.jsto set CORS headers on all requests.src/converters/strategies/OpenAIResponsesConverter.jsto support flexible input formats.tests/cors-config.test.jsandtests/openai-responses-converter.test.js.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.