ladjs / superagent

Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
https://ladjs.github.io/superagent/
MIT License
16.57k stars 1.33k forks source link

fix: replace deprecated `url.parse()` with `new URL()` #1803

Closed alumni closed 2 months ago

alumni commented 2 months ago

Checklist

Replaces the other occurrences of url.parse() with new URL(). Continuation of PR #1802.

titanism commented 2 months ago

Can you fix merge conflict @alumni ?

titanism commented 2 months ago

released in v9.0.2

https://github.com/ladjs/superagent/releases/tag/v9.0.2

foresterre commented 1 month ago

This is possibly a breaking change. Previously, a value like "0.0.0.0" was accepted, while it now errors with "0.0.0.0 is not a valid URL"

gramakri commented 3 weeks ago

@alumni I think this change broke IPv6 queries. See https://github.com/ladjs/superagent/pull/1805 . The change makes node resolve [x]:port as a hostname instead of IPv6 address.

alumni commented 3 weeks ago

There's a pr open to fix it ;)

gramakri commented 3 weeks ago

@alumni ah, I was hoping you would review that PR :-D (also, there was an edit in that PR saying it's hard to test)