fix(serve): don't set header origin if using an agent (#1179)

This commit is contained in:
Sabith Karippullil Soopy
2018-04-26 13:19:50 -07:00
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)
}
},