mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-24 22:09:54 -05:00
fix(serve): don't set header origin if using an agent (#1179)
This commit is contained in:
committed by
Evan You
parent
11ccf64322
commit
79bc088beb
@@ -86,7 +86,7 @@ module.exports = function prepareProxy (proxy, appPublicFolder) {
|
||||
// Browsers may send Origin headers even with same-origin
|
||||
// requests. To prevent CORS issues, we have to change
|
||||
// the Origin to match the target URL.
|
||||
if (proxyReq.getHeader('origin')) {
|
||||
if (!proxyReq.agent && proxyReq.getHeader('origin')) {
|
||||
proxyReq.setHeader('origin', target)
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user