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: format ignores query if it's no object #6004

Closed
ajafff opened this issue Apr 1, 2016 · 0 comments
Closed

url: format ignores query if it's no object #6004

ajafff opened this issue Apr 1, 2016 · 0 comments
Labels
url Issues and PRs related to the legacy built-in url module.

Comments

@ajafff
Copy link
Contributor

ajafff commented Apr 1, 2016

  • Version: v6.0.0-pre (master)
  • Platform: Linux klaus-ThinkPad-T410 4.2.0-34-generic Gitter chat room? #39-Ubuntu SMP Thu Mar 10 22:13:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: url
var assert = require('assert');
var url = require('url');
assert.equal(url.format({pathname:'/foo', query: 'bar=baz'}), '/foo?bar=baz');

results in AssertionError: '?bar=baz' == '/foo?bar=baz'

If search is falsy, query is used. Unfortunately query is only used, if it is an object. Strings are currently ignored.

PR incoming

@jasnell jasnell added the url Issues and PRs related to the legacy built-in url module. label Apr 2, 2016
@ajafff ajafff closed this as completed Apr 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
url Issues and PRs related to the legacy built-in url module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants