Skip to content

Url.parse does not handle repeated query parameters correctly #31

@sqrrrl

Description

@sqrrrl

Found an issue where flat parameters are discarded when passing in a URL to client.get. Specifically, I'm calling client.get(url) with an absolute URL that has a repeated parameter. Even though the client instance is configured to use the flat encoder, I'm seeing only the last value.

Looks like client.request is calling URL.join() to merge the URL with the base URL (in this case the base is null.) This is where it breaks:

Example:
Hurley::Url.join(nil, 'https://www.foo.com?a=b&a=b2')
#<Hurley::Url https://www.foo.com?a=b2>

Notice only the last value of a is preserved. Expected result is that both pairs would be retained.

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