From 50ee6eb2ff149ab3f3b67af839680a0e2ea9eedc Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Mon, 27 Feb 2012 14:54:13 +0100 Subject: Bug 730670: Do not redirect in buglist.cgi to improve performance r=glob a=LpSolit --- Bugzilla/CGI.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Bugzilla') diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index 9f50aba32..98fa3d79b 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -189,7 +189,10 @@ sub clean_search_url { # list_id is added in buglist.cgi after calling clean_search_url, # and doesn't need to be saved in saved searches. - $self->delete('list_id'); + $self->delete('list_id'); + + # no_redirect is used internally by redirect_search_url(). + $self->delete('no_redirect'); # And now finally, if query_format is our only parameter, that # really means we have no parameters, so we should delete query_format. @@ -445,6 +448,7 @@ sub redirect_search_url { return; } + my $no_redirect = $self->param('no_redirect'); $self->clean_search_url(); # Make sure we still have params still after cleaning otherwise we @@ -458,6 +462,10 @@ sub redirect_search_url { $self->param('list_id', $recent_search->id); } + # Browsers which support history.replaceState do not need to be + # redirected. We can fix the URL on the fly. + return if $no_redirect; + # GET requests that lacked a list_id are always redirected. POST requests # are only redirected if they're under the CGI_URI_LIMIT though. my $uri_length = length($self->self_url()); -- cgit v1.2.3-24-g4f1b