Skip to content

new URLSearchParams([[key1, val1], [key2, val2]]) is not working #12778

Description

@caub
new url.URLSearchParams([['param1', 'val1'], ['...', '...']])+'';

This should output "param1=val1&...=..."

But it outputs 'param1%2Cval1%2C...%2C...='

The spec describes it here https://url.spec.whatwg.org/#urlsearchparams, the constructor should accept either a query-string, array of [key, value]'s or plain-object

Node version tested 7.9.0

Activity

  1. added
    urlIssues and PRs related to the legacy built-in url module.
    on May 1, 2017
  2. added
    whatwg-urlIssues and PRs related to the WHATWG URL implementation.
    and removed
    urlIssues and PRs related to the legacy built-in url module.
    on May 1, 2017
  3. TimothyGu commented on May 2, 2017

    @TimothyGu
    Member

    This issue can be considered to be a duplicate of #10635. Node.js master branch has supported this feature since Jan 31 (#11060), and v7.10.0 will be released with that commit (backport PR #12507). The feature was held back from landing in any v7.x releases because of potential future changes in the constructor (whatwg/url#204), but as that cause was stalled I have landed it in v7.x just recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    whatwg-urlIssues and PRs related to the WHATWG URL implementation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions