Skip to content

Replace deprecated url.parse in proxy resolution - #129

Open
Trivikram Kamat (trivikr) wants to merge 1 commit into
microsoft:mainfrom
trivikr:remove-deprecated-url-parse
Open

Trivikram Kamat (trivikr) wants to merge 1 commit into
microsoft:mainfrom
trivikr:remove-deprecated-url-parse

Conversation

@trivikr

Copy link
Copy Markdown

Replaces url.parse() with WHATWG URL in useProxySettings() so the patched fetch in the extension host and agent host no longer emits DEP0169.

Supersedes #114 (rebased onto main, Josh Mouch (@joshmouch) credited as co-author).

  • Parse with the WHATWG URL API. Strip IPv6 brackets from hostname so localhost and noProxy checks still see ::1, and match the normalized ::ffff:7f00:1 form of ::ffff:127.0.0.1.
  • The proxy cache key is now protocol//host. Credentials in the request URL are no longer part of the key.
  • Adds tests for IPv6 loopback, per-scheme/host/port caching, and the absence of DEP0169.

Tested: npm run compile, npm run test:unit. The DEP0169 test fails without the change.

Co-authored-by: Joshua Mouch <3098820+joshmouch@users.noreply.github.com>
@trivikr

Copy link
Copy Markdown
Author

Christof Marti (@chrmarti) could you review this when you get a chance?

It replaces url.parse() in useProxySettings(), which emits DEP0169 whenever an extension calls the global fetch() in the extension host.

Extensions can't suppress the warning because VS Code strips NODE_OPTIONS from the extension host.

This supersedes #114, which has had conflicts since October.

@Jason3S

Copy link
Copy Markdown

Trivikram Kamat (@trivikr),

Thank you for the fix.

I ended up here too:
image

@trivikr

Copy link
Copy Markdown
Author

Christof Marti (@chrmarti) Dmitriy Vasyura (@dmitrivMS) friendly ping.

Jason Dent (@Jason3S)'s comment above shows other extensions hit this DEP0169 warning too, and extension authors can't suppress it from their side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants