Skip to content

SetQueryParams with collection of KV pairs, duplicate keys should append, not overwrite #370

Description

@tmenier

Flurl allows setting multiple query parameters via object notation, with special handling for things that look like collections of key/value pairs. It's possible that these collections could contain duplicate keys, and in this case every value should be appended. Instead they get overwritten each time, so this test fails:

var url = "http://foo.com".SetQueryParams(new[] {
    new { key = "x", value = 1 },
    new { key = "x", value = 2 },
});

Assert.AreEqual("http://foo.com?x=1&x=2", url.ToString());
// fail! actual value is http://foo.com?x=2

In a nutshell, that should pass.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    Released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions