Subject: | The url method uses the wrong params to get the query string |
Date: | Fri, 27 May 2011 17:19:57 -0500 |
To: | bug-CGI [...] rt.cpan.org |
From: | Jacob Gelbman <gelbman [...] gmail.com> |
The url method is using the wrong params to get the query string. For
example the following cgi script, returns (what should be) the url for
itself:
#!/usr/bin/env perl
use CGI;
my $q = CGI->new;
print $q->header, $q->url(-query => 1);
If I fetch the page like this
$ curl http://localhost/urlprob.cgi?a=b
It will respond with:
http://localhost/urlprob.cgi?a=b
But if I post something to the page:
$ curl -d p=XXX http://localhost/urlprob.cgi?a=b
It responds with:
http://localhost/urlprob.cgi?p=XXX
I think the url method should ALWAYS use the url params.