Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
Closed
Description
What steps will reproduce the bug?
We use url.resolve a LOT. It's a great function that also inspired me to write a PHP version with 8 million downloads =)
I recently discovered that url.resolve() was marked as deprecated, and that users should use URL instead.
Aside from the fact that WhatWG URL is not a real RFC3986 uri, there's also a a very simple feature missing. We use url.resolve all the time to do things like this:
constnewUrl=url.resolve('/base''?foo=bar');The URL object does not let us work with relative urls:
>newURL('?foo=bar','/bar');UncaughtTypeError[ERR_INVALID_URL]: Invalid URL: /baratonParseError(internal/url.js:259:9)atnewURL(internal/url.js:335:5)atnewURL(internal/url.js:332:22)at REPL11:1:1atScript.runInThisContext(vm.js:133:18)atREPLServer.defaultEval(repl.js:484:29)atbound(domain.js:413:15)atREPLServer.runBound[aseval](domain.js:424:12)atREPLServer.onLine(repl.js:817:10)atREPLServer.emit(events.js:327:22){input: '/bar',code: 'ERR_INVALID_URL'Metadata
Metadata
Assignees
Labels
No labels