diff options
author | Dave Lawrence <dkl@redhat.com> | 2010-03-03 16:23:07 -0500 |
---|---|---|
committer | David Lawrence <dkl@redhat.com> | 2010-03-03 16:23:07 -0500 |
commit | 8111ba2fde69e60c6ebcbb8669dee5089d283983 (patch) | |
tree | f8bb8d21c3e8ef7eff7a72fea085b960ca176bf0 | |
parent | Bug 548933: The "Mark as Duplicate" link was changing bugs to RESOLVED FIXED (diff) | |
download | bugzilla-8111ba2fde69e60c6ebcbb8669dee5089d283983.tar.gz bugzilla-8111ba2fde69e60c6ebcbb8669dee5089d283983.tar.bz2 bugzilla-8111ba2fde69e60c6ebcbb8669dee5089d283983.zip |
Bug 513989 - large search query causing internal server error (500) but valid redirect 302 returned
r=mkanat, a=mkanat
-rw-r--r-- | Bugzilla/Constants.pm | 7 | ||||
-rwxr-xr-x | buglist.cgi | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index 0e35aa0c6..e925a83b6 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -161,6 +161,8 @@ use File::Basename; PASSWORD_DIGEST_ALGORITHM PASSWORD_SALT_LENGTH + + CGI_URI_LIMIT ); @Bugzilla::Constants::EXPORT_OK = qw(contenttypes); @@ -462,6 +464,11 @@ use constant PASSWORD_DIGEST_ALGORITHM => 'SHA-256'; # of your users will be able to log in until they reset their passwords. use constant PASSWORD_SALT_LENGTH => 8; +# Certain scripts redirect to GET even if the form was submitted originally +# via POST such as buglist.cgi. This value determines whether the redirect +# can be safely done or not based on the web server's URI length setting. +use constant CGI_URI_LIMIT => 10000; + sub bz_locations { # We know that Bugzilla/Constants.pm must be in %INC at this point. # So the only question is, what's the name of the directory diff --git a/buglist.cgi b/buglist.cgi index b6d642d6b..5c7b6762d 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -85,9 +85,11 @@ if (grep { $_ =~ /^cmd\-/ } $cgi->param()) { # if ($cgi->request_method() eq 'POST') { $cgi->clean_search_url(); - - print $cgi->redirect(-url => $cgi->self_url()); - exit; + my $uri_length = length($cgi->self_url()); + if ($uri_length < CGI_URI_LIMIT) { + print $cgi->redirect(-url => $cgi->self_url()); + exit; + } } # Determine whether this is a quicksearch query. |