Skip to content

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

@ajafff

Description

@ajafff
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    urlIssues and PRs related to the legacy built-in url module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions