Skip to content

Two "?"s added to url #37

@MartinSStewart

Description

@MartinSStewart

I wanted to take an existing url and modify the query parameters. I noticed Url is just a record type so I figured the correct way to do this is

{ currentUrl
    | query =
        Url.Builder.toQuery [ Url.Builder.string "data" "test" ] |> Just
}
    |> Url.toString

but when I did that the result was http://localhost:3000/??data=test instead of http://localhost:3000/?data=test.

This seems to be a bug or at least unintuitive behavior and what I ended up doing to make it work was add String.dropLeft 1 to the toQuery 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