Skip to content

Commit

Permalink
fix: remove object situation
Browse files Browse the repository at this point in the history
  • Loading branch information
PengBoUESTC committed Nov 18, 2022
1 parent 2001dcf commit 5b449f4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 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 All @@ -26,7 +26,7 @@ export interface ProxyOptions extends HttpProxy.ServerOptions {
req: http.IncomingMessage,
res: http.ServerResponse,
options: ProxyOptions
) => void | null | undefined | false | string | HttpProxy.ServerOptions
) => void | null | undefined | false | string
}

export function proxyMiddleware(
Expand Down Expand Up @@ -121,9 +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)
} else if (bypassResult === false) {
debug(`bypass: ${req.url} -> 404`)
return res.end(404)
Expand Down

0 comments on commit 5b449f4

Please sign in to comment.