feat!: update http-proxy-middleware v3, remove bypass and path options#101
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
bypass and path op…bypass and path options
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request updates the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Pull request overview
Updates the dev-server’s proxy integration to align with http-proxy-middleware v3, removing deprecated/removed proxy options (bypass, path) and updating affected E2E tests accordingly.
Changes:
- Bump
http-proxy-middlewarefrom^2.0.9to^3.0.5(and lockfile updates). - Migrate proxy configuration usage from
logLevel/onProxyReqWstologger/on.{...}where required by v3. - Remove dev-server support/types for legacy
bypassandpathproxy options; adapt server proxy middleware creation topathFilter.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/web-socket-server-url.test.js | Updates proxy middleware options for v3 (logger instead of logLevel). |
| tests/e2e/allowed-hosts.test.js | Updates proxy middleware options & event hooks to v3-style on + logger. |
| src/types.ts | Removes bypass/path typing; documents context as an alias for pathFilter. |
| src/server.ts | Adjusts default proxy logger wiring and proxy middleware instantiation for v3 (pathFilter + logger). |
| package.json | Updates http-proxy-middleware dependency to ^3.0.5. |
| pnpm-lock.yaml | Lockfile changes reflecting the dependency upgrade and new transitive deps. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request updates http-proxy-middleware to version 3, refactoring the proxy configuration logic and removing deprecated options like bypass and path. A security vulnerability has been identified in the new deprecation warning logic. Sensitive proxy configuration details, including authentication credentials and headers, could be exposed in console logs due to the stringification of the entire configuration object when an invalid configuration is detected. Please address this potential information leakage.
| if (typeof item.logger === 'undefined') { | ||
| item.logger = this.logger as EXPECTED_ANY; | ||
| } |
There was a problem hiding this comment.
This logic to set a default logger is redundant. A similar check exists in getProxyMiddleware (lines 1900-1902), which handles all proxy configurations (both objects and functions). To centralize the logic and avoid duplication, this block can be removed. In fact, the entire if (typeof options.proxy !== 'undefined') block from line 1167 to 1179 can be removed as this is its only effective operation.
Summary
This PR upgrades
http-proxy-middlewareto v3 and removes legacy proxy compatibility paths in@rspack/dev-server.Breaking Changes
Removed deprecated
proxy[].bypasssupportbypass.Removed legacy
proxy[].pathsupportpathoption is no longer supported in proxy items.pathFilter(orcontextalias) instead.Aligned with
http-proxy-middlewarev3 APIlogLevel,logProvider, top-level proxy event callbacks).loggerandon: { ... }event hooks.Migration Notes
bypass->pathFIlterorrouterpath->pathFilter.logLevel/logProvider->logger.onProxyReq,onProxyReqWs, etc. ->on: { proxyReq, proxyReqWs, ... }.Ref
https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md