Skip to content

Commit

Permalink
fix(server): keep origin by default in proxy (#9193)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Sep 1, 2022
1 parent 420a13d commit 4fdf478
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/server/src/Server/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,6 @@ class Server {
return createProxyMiddleware(context!, {
...proxyConfig,
onProxyReq(proxyReq, req: any, res) {
// 修改 host 模拟域名,避免 cors 只允许固定域名时报错
if (proxyReq.getHeader('origin')) {
proxyReq.setHeader('origin', target);
}
proxyConfig.onProxyReq?.(proxyReq, req, res);
},
onProxyRes(proxyRes, req: any, res) {
Expand Down

0 comments on commit 4fdf478

Please sign in to comment.