Skip to content

Commit

Permalink
chore: proxy bypass do nothing with object result (#10209)
Browse files Browse the repository at this point in the history
  • Loading branch information
PengBoUESTC committed Nov 21, 2022
1 parent 0e271ff commit 934a304
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/vite/src/node/server/middlewares/proxy.ts
Expand Up @@ -5,7 +5,7 @@ import type { Connect } from 'dep-types/connect'
import type { HttpProxy } from 'dep-types/http-proxy'
import colors from 'picocolors'
import { HMR_HEADER } from '../ws'
import { createDebugger, isObject } from '../../utils'
import { createDebugger } from '../../utils'
import type { CommonServerOptions, ResolvedConfig } from '../..'

const debug = createDebugger('vite:proxy')
Expand Down Expand Up @@ -121,10 +121,6 @@ export function proxyMiddleware(
req.url = bypassResult
debug(`bypass: ${req.url} -> ${bypassResult}`)
return next()
} else if (isObject(bypassResult)) {
Object.assign(options, bypassResult)
debug(`bypass: ${req.url} use modified options: %O`, options)
return next()
} else if (bypassResult === false) {
debug(`bypass: ${req.url} -> 404`)
return res.end(404)
Expand Down

0 comments on commit 934a304

Please sign in to comment.