chore: 添加 CORS 头过滤注释说明(代码审查反馈)

Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-10 14:39:20 +00:00
parent df64cb221d
commit 0de4170ee7
1 changed files with 3 additions and 1 deletions

View File

@ -735,7 +735,9 @@ function proxyToPersonaStudio(req, res, fullPath) {
};
const proxyReq = http.request(options, (proxyRes) => {
// Forward status and headers (preserve CORS headers already set)
// Forward status and headers, but skip backend's CORS headers
// because the api-proxy already set CORS headers via setCorsHeaders()
// at the top of the request handler — forwarding both would cause duplicates
const headers = {};
for (const [key, value] of Object.entries(proxyRes.headers)) {
if (!key.startsWith('access-control-')) {