You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Looks like changing the default query parser to flat helps a little if I change my code and re-apply the query:
client.get(url) do |req|
req.query.update query
end
But it still is a bug in that the initial parsing is broken.
It also is clear that Hurley is ignoring the client/request parser preference. req.query is coming back as Nested, even though the client is configured for flat. Since I'm using this in a library, I don't want to rely on having to change the default behavior as it could interfere with other usages.
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.
The text was updated successfully, but these errors were encountered: