-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.whatwg-urlIssues and PRs related to the WHATWG URL implementation.Issues and PRs related to the WHATWG URL implementation.
Description
Currently the new whatwg url class doesn't seem to work with any other scheme except so called 'special schemes' in the spec:
https://url.spec.whatwg.org/
E.g. this works:
const { URL } = require('url');
const url = new URL('http://foo.bar');
url.protocol = 'ftp';
url.toString(); // => ftp://foo.bar
But this doesn't work:
const { URL } = require('url');
const url = new URL('http://foo.bar');
url.protocol = 's3';
url.toString(); // http://foo.bar => should be s3://foo.bar
Even schemes defined here: https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml don't work.
Not that this does work:
const { URL } = require('url');
const url = new URL('s3://foo.bar');
url.protocol; // = s3:
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.whatwg-urlIssues and PRs related to the WHATWG URL implementation.Issues and PRs related to the WHATWG URL implementation.