Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: skip undefined proxy entry #9622

Merged
merged 7 commits into from Aug 16, 2022
4 changes: 2 additions & 2 deletions packages/vite/src/node/server/middlewares/proxy.ts
Expand Up @@ -37,8 +37,8 @@ export function proxyMiddleware(
// lazy require only when proxy is used
const proxies: Record<string, [HttpProxy.Server, ProxyOptions]> = {}

for(let context in options) {
if(!options[context]) continue
for (const context in options) {
if (!options[context]) continue
sapphi-red marked this conversation as resolved.
Show resolved Hide resolved
let opts = options[context]
if (typeof opts === 'string') {
opts = { target: opts, changeOrigin: true } as ProxyOptions
Expand Down