Query Parameters Are Duplicated #174

wants to merge 1 commit into


None yet

2 participants

dmw397 commented Jun 27, 2011

The query parameters in GET requests are being duplicated. For example, the URL:


generates a parameter hash that looks like this:

a => ['foo', 'foo'],
b => ['bar', 'bar'],

The root of the problem seems to be that Mojo::Parameters::parse doesn't clear _string before parsing the input string. As a result, _string is parsed and the new query parameters are added to it instead of replacing it.

kraih commented Jun 27, 2011

This does not appear to be true.

perl -Mojo -E'a("/" => sub { $_[0]->render_text($_[0]->dumper($_[0]->req->url->query->to_hash)) })->start' get '/?a=foo&b=bar'

You also seem to have forgotten unit tests.

@kraih kraih closed this Jun 27, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment