Skip to content

Comments

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

Open
w666 wants to merge 7 commits intomasterfrom
feature-1380-replace-url-parse
Open

Replace depricated url.parse with the WHATWG URL API#1387
w666 wants to merge 7 commits 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
w666 and others added 6 commits February 21, 2026 08:31
copilot suggestion

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
copilot suggestion

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
do not return default port

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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

1 participant