-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Closed
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.semver-majorPRs that contain breaking changes and should be released in the next major version.PRs that contain breaking changes and should be released in the next major version.stalledIssues and PRs that are stalled.Issues and PRs that are stalled.urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.
Description
I noticed this when working on #2271 - regardless of which one you think should "win", you'd expect the last two lines here to end up with the same url:
var myUrl = url.parse('http://foo.com/');
myUrl.host = 'bar.com';
url.format(myUrl); // => 'http://bar.com/'
http.get(myUrl); // makes a request to http://foo.com/
To node/io.js's credit, they are both documented correctly, but that only goes so far.
I don't really care which one wins (I suppose I'd pick hostname
if I had to choose), but I think we should consider making a breaking change at some point in order to make those two APIs more consistent.
(Getters and setters on Url objects would help, but I could imagine someone doing this to a regular Object as well, so I still think the APIs should be consistent.)
Metadata
Metadata
Assignees
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.semver-majorPRs that contain breaking changes and should be released in the next major version.PRs that contain breaking changes and should be released in the next major version.stalledIssues and PRs that are stalled.Issues and PRs that are stalled.urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.