qs icon indicating copy to clipboard operation
qs copied to clipboard

Please add decodeURIComponent() to parse GET parameters correctly

Open andrewi-wd opened this issue 7 years ago • 0 comments

In case we have array of GET parameters like ?filters[showDeleted]=1,filters[hideInactive]=1 gs.get() will return encoded params with replaced special symbols

params = {
    "filters%5BshowDeleted%5D": 1,
    "filters%5BhideInactive%5D": 1,
}

Problem appears than I am trying to reload page with new GET params, there %5B and %5D are encoded one more time to %255B and %255D accordingly.

var r=decodeURIComponent(window.location.search) solves that:

params = {
    "filters[showDeleted]": 1,
    "filters[hideInactive]": 1,
}

andrewi-wd avatar Mar 24 '17 08:03 andrewi-wd