Skip to content

Commit 79bc088

Browse files
sksyyx990803
authored andcommitted
fix(serve): don't set header origin if using an agent (#1179)
1 parent 11ccf64 commit 79bc088

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/@vue/cli-service/lib/util/prepareProxy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module.exports = function prepareProxy (proxy, appPublicFolder) {
8686
// Browsers may send Origin headers even with same-origin
8787
// requests. To prevent CORS issues, we have to change
8888
// the Origin to match the target URL.
89-
if (proxyReq.getHeader('origin')) {
89+
if (!proxyReq.agent && proxyReq.getHeader('origin')) {
9090
proxyReq.setHeader('origin', target)
9191
}
9292
},

0 commit comments

Comments
 (0)