Skip to content

Replace depricated url.parse with the WHATWG URL API#1387

Open
w666 wants to merge 1 commit intomasterfrom
feature-1380-replace-url-parse
Open

Replace depricated url.parse with the WHATWG URL API#1387
w666 wants to merge 1 commit intomasterfrom
feature-1380-replace-url-parse

Conversation

@w666
Copy link
Collaborator

@w666 w666 commented Nov 18, 2025

close #1380

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to replace the deprecated url.parse() API with the WHATWG URL API to resolve Node.js v24 deprecation warnings. The changes affect URL parsing in WSDL processing, HTTP client request building, and server request handling.

Changes:

  • Removed url module imports from src/wsdl/index.ts, src/server.ts, and src/http.ts
  • Replaced url.parse() and url.resolve() calls with WHATWG URL API constructors
  • Added helper functions getServerBaseUrl() and getPortFromUrl() to support URL parsing
  • Modified IExpressApp interface to extend http.Server
  • Added try-catch error handling to a test case

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.

File Description
src/wsdl/index.ts Replaced url.resolve() with WHATWG URL API for WSDL include resolution
src/server.ts Replaced url.parse() with WHATWG URL API, added getServerBaseUrl() helper, modified IExpressApp interface
src/http.ts Replaced url.parse() with WHATWG URL API, added getPortFromUrl() helper function
test/client-test.js Added try-catch error handling to Host header test

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@w666 w666 force-pushed the feature-1380-replace-url-parse branch from 08ca407 to 5d12103 Compare February 20, 2026 19:29
@smokhov
Copy link
Contributor

smokhov commented Feb 21, 2026

How much do you really trust copilot to do the right thing?

@w666
Copy link
Collaborator Author

w666 commented Feb 21, 2026

Ah, it is kinda useless, was just experimenting with it past week. Also was wondering if it helps with this PR, as I am still not sure if I should release this.

@w666 w666 force-pushed the feature-1380-replace-url-parse branch from a13e836 to e2e4e0d Compare February 22, 2026 17:50
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.

URL.PARSE() uses deprecation, security warning message in Node.js v24

3 participants