Skip to content
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

url: fix format when query is not an object #6005

Closed
wants to merge 1 commit into from
Closed

url: fix format when query is not an object #6005

wants to merge 1 commit into from

Conversation

ajafff
Copy link
Contributor

@ajafff ajafff commented Apr 1, 2016

Pull Request check-list

Please make sure to review and check all of these items:

  • Does make -j8 test (UNIX) or vcbuild test nosign (Windows) pass with
    this change (including linting)?
  • Is the commit message formatted according to CONTRIBUTING.md?
  • If this change fixes a bug (or a performance problem), is a regression
    test (or a benchmark) included?
  • Is a documentation update included (if this change modifies
    existing APIs, or introduces new ones)?

Affected core subsystem(s)

url

Description of change

url.format uses query if search is falsy. Currently query is only used
if it is an object. Query will now be inserted if its value is truthy.

Fixes: #6004

url.format uses query if search is falsy. Currently query is only used
if it is an object. Query will now be inserted if its value is truthy.

Fixes: #6004
@jasnell jasnell added url Issues and PRs related to the legacy built-in url module. semver-minor PRs that contain new features and should be released in the next minor version. labels Apr 2, 2016
@mscdex
Copy link
Contributor

mscdex commented Apr 2, 2016

@cjihrig
Copy link
Contributor

cjihrig commented Apr 2, 2016

This would require a documentation update.

@@ -1586,3 +1586,6 @@ for (let i = 0; i < throws.length; i++) {
}
assert(url.format('') === '');
assert(url.format({}) === '');

// https://github.com/nodejs/node/issues/6004
assert.equal(url.format({pathname:'/foo', query: 'bar=baz'}), '/foo?bar=baz');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit: there should be a space after pathname:

@benjamingr
Copy link
Member

Isn't this a semver major since an error is no longer thrown where an error was thrown before?

@jasnell
Copy link
Member

jasnell commented Apr 4, 2016

@benjamingr ... I may be missing something but I'm not seeing a change in error handling.

@ajafff ... while this is generally ok, I'm curious why not simply use search?

@cjihrig
Copy link
Contributor

cjihrig commented Jun 16, 2016

@ajafff are you still planning to work on this?

@rvagg rvagg force-pushed the master branch 2 times, most recently from c133999 to 83c7a88 Compare October 18, 2016 17:01
@jasnell jasnell added the stalled Issues and PRs that are stalled. label Mar 1, 2017
@jasnell
Copy link
Member

jasnell commented Mar 1, 2017

Closing given the lack of forward progress on this

@jasnell jasnell closed this Mar 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-minor PRs that contain new features and should be released in the next minor version. stalled Issues and PRs that are stalled. url Issues and PRs related to the legacy built-in url module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

url: format ignores query if it's no object
5 participants