chore: 添加 CORS 头过滤注释说明(代码审查反馈)
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
parent
df64cb221d
commit
0de4170ee7
|
|
@ -735,7 +735,9 @@ function proxyToPersonaStudio(req, res, fullPath) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const proxyReq = http.request(options, (proxyRes) => {
|
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 = {};
|
const headers = {};
|
||||||
for (const [key, value] of Object.entries(proxyRes.headers)) {
|
for (const [key, value] of Object.entries(proxyRes.headers)) {
|
||||||
if (!key.startsWith('access-control-')) {
|
if (!key.startsWith('access-control-')) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue