Skip to content

unexpected encode behaviour for set query #220

Description

@herbertpimentel

It results unexpected encoding, depending of the type of input used on set query

var parsed = urlParse('http://go.com/');

parsed.set('query', 'promo=20%25');
console.log(parsed.href);   //outputs: "http://go.com/?promo=20%25"

parsed.set('query', {promo:'20%25'});
console.log(parsed.href);   //outputs: "http://go.com/?promo=20%2525"

https://codepen.io/herbertpimentel/pen/vYeeVdz?editors=0011

Expected result: in both cases have the same output.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions