-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.
Description
- Version: master
- Platform: Windows
- Subsystem: url
Parsing a URL without a search part changes its behavior if parseQueryString
is set:
> url.parse('http://example.com/', false).search
null
> url.parse('http://example.com/', true).search
''
We should probably change this line
this.search = '';
to this
this.search = null;
Users most likely will not expect parseQueryString
to affect the value of .search
.
There was a similar discussion at #9600, but @sam-github and I both think that the behavior discussed there is in fact justifiable.
Is there any justification for this behavior or do we consider this a bug? If we do, I will create a semver-major PR later. (I know that we do not plan to make any big changes to the old url API, but I would personally consider this a bug.)
cc @nodejs/url
Metadata
Metadata
Assignees
Labels
urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.