Subject: | URIs not Equivalent with Differently Ordered Query Strings |
Date: | Tue, 27 Nov 2012 16:53:50 -0800 |
To: | bug-libwww-perl [...] rt.cpan.org |
From: | "David E. Wheeler" <dwheeler [...] cpan.org> |
Noticed while investigating this test failure:
http://www.cpantesters.org/cpan/report/4a41cd2e-33d9-11e2-9885-9ffb7a36a9a6
I suspect that this is due to the hash order randomization in 5.17, since these tests only fail on 5.17. I think it is reasonable for query_form() to process things in whatever order it likes, but shouldn't two URIs with the same query params be equivalent, even if the params are in the string in different order?
In other words, should this not emit "Yes"?
perl -MURI -E 'say URI->new("foo.bar?b=1&o=1&a=s")->eq(URI->new("foo.bar?o=1&a=s&b=1")) ? "yes" : "no"'
Of course these are different query strings:
b=1&o=1&a=s
o=1&a=s&b=1
But are they not functionally the same?
{ b => 1, o => 1, a => 's' }
Thanks,
David