Skip to content

uri.? doesn't concatenate #19782

Open
Open
@dom96

Description

@dom96

I expected ? to not overwrite the query, but to merge. The docs of the proc use the word "concatenate" which implies that this is how the proc should work, but the implementation overwrites the query instead of concatenating.

Example

import uri
let foo = parseUri("https://google.com/?page=10")
echo(foo ? {"test": "42"})

Current Output

https://google.com/?test=42

Expected Output

https://google.com/?page=10&test=42

Possible Solution

Workaround is:

echo(foo ? (toSeq(foo.query.decodeQuery()) & @({"test": "42"})))

We can either change the semantics behind a feature flag (to avoid breaking existing code) or update the docs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions