Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quiet-local-proxy-urls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vercel/microfrontends': patch
---

Avoid Node.js `url.parse()` deprecation warnings when routing requests through the local proxy.
2 changes: 2 additions & 0 deletions packages/microfrontends/src/bin/local-proxy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@ describe('class LocalProxy', () => {
expect.anything(),
res,
expect.objectContaining({
toProxy: true,
headers: expect.objectContaining({
'x-forwarded-proto': 'https',
'x-forwarded-host': 'vercel.localhost',
Expand Down Expand Up @@ -1097,6 +1098,7 @@ describe('class LocalProxy', () => {
socket,
head,
expect.objectContaining({
toProxy: true,
headers: expect.objectContaining({
'x-forwarded-proto': 'https',
'x-forwarded-host': 'vercel.localhost',
Expand Down
6 changes: 6 additions & 0 deletions packages/microfrontends/src/bin/local-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,9 @@ export class LocalProxy {
this.proxy.ws(req, socket, head, {
target: target.url,
headers,
// Forward the origin-form request target directly instead of letting
// http-proxy parse it with Node.js's deprecated url.parse().
toProxy: true,
});
} catch (err) {
logger.error('Error proxying ws: ', err);
Expand Down Expand Up @@ -927,6 +930,9 @@ export class LocalProxy {
this.proxy.web(strippedReq, res, {
target: target.url,
headers,
// Forward the origin-form request target directly instead of letting
// http-proxy parse it with Node.js's deprecated url.parse().
toProxy: true,
});
}
}
Expand Down
Loading