Skip to content

unexpected encode behaviour for set query #220

Open
@herbertpimentel

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.

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