-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation for http.message.url suggests using deprecated url API #30048
Comments
The WHATWG URL API will not work in this case unless a bogus base URL is provided as second argument. |
@lpinca Can I work on this issue? |
Yes but again, there is no equivalent for WHATWG URL. |
Hmm… Should I remove deprecated docs or update with WHATWG URL to provide a bogus URL as second argument? If the later, I will replace it like this: > new URL('/status?name=ryan', 'https://nodejs.org')
URL {
href: 'https://nodejs.org/status?name=ryan',
origin: 'https://nodejs.org',
protocol: 'https:',
username: '',
password: '',
host: 'nodejs.org',
hostname: 'nodejs.org',
port: '',
pathname: '/status',
search: '?name=ryan',
searchParams: URLSearchParams { 'name' => 'ryan' },
hash: ''
} |
@nodejs/url |
@lpinca i would like to work on this issue. |
In the context of
(or Then give some examples like the one in #30048 (comment) |
@joyeecheung Thank you for a good idea! I will try to refactor doc soon. |
Update message.url example to use The WHATWG URL API. This is because the old example suggests using deprecated url API. Fixes: nodejs#30048 Refs: https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_message_url
Wrapped at 80 characters and refactored. Fixes: nodejs#30048 Refs: nodejs#30830
At the following piece of documentation (for v12; the latest one):
It describes:
However, this legacy
url
module/API is deprecated since v11.Thus, the documentation should be updated.
Bonus points for grepping the rest of the documentation to find other outdated examples.
The text was updated successfully, but these errors were encountered: