Skip to content

Commit

Permalink
fix: default changeOrigin to true in proxy option shorthand
Browse files Browse the repository at this point in the history
fix #1577
  • Loading branch information
yyx990803 committed Jan 19, 2021
1 parent 9225c5f commit b008bd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/server/middlewares/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function proxyMiddleware({
Object.keys(options).forEach((context) => {
let opts = options[context]
if (typeof opts === 'string') {
opts = { target: opts } as ProxyOptions
opts = { target: opts, changeOrigin: true } as ProxyOptions
}
const proxy = httpProxy.createProxyServer(opts) as HttpProxy.Server

Expand Down

0 comments on commit b008bd5

Please sign in to comment.