From fb098a942b925296e0e86b6935a4fdda872e2f99 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 2 Jan 2009 12:34:40 +0100 Subject: [PATCH 1/2] gitweb: don't use pathinfo for global actions With PATH_INFO urls, actions for the projects list (e.g. opml, project_index) were being put in the URL right after the base. The resulting URL is not properly parsed by gitweb itself, since it expects a project name as first component of the URL. Accepting global actions in use_pathinfo is not a very robust solution due to possible present and future conflicts between project names and global actions, therefore we just refuse to create PATH_INFO URLs when the project is not defined. Signed-off-by: Giuseppe Bilotta Acked-by: Jakub Narebski Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 7999bb37d3..b16400193d 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -830,7 +830,7 @@ sub href (%) { } my $use_pathinfo = gitweb_check_feature('pathinfo'); - if ($use_pathinfo) { + if ($use_pathinfo and defined $params{'project'}) { # try to put as many parameters as possible in PATH_INFO: # - project name # - action @@ -845,7 +845,7 @@ sub href (%) { $href =~ s,/$,,; # Then add the project name, if present - $href .= "/".esc_url($params{'project'}) if defined $params{'project'}; + $href .= "/".esc_url($params{'project'}); delete $params{'project'}; # since we destructively absorb parameters, we keep this From ae35785e3a205cea04d228b00461f4906548fcc3 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 2 Jan 2009 13:49:30 +0100 Subject: [PATCH 2/2] gitweb: suggest name for OPML view Suggest opml.xml as name for OPML view by providing the appropriate header, consistently with similar usage in project_index view. Signed-off-by: Giuseppe Bilotta Acked-by: Jakub Narebski Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index b16400193d..995bc1a6a9 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -6122,7 +6122,11 @@ sub git_atom { sub git_opml { my @list = git_get_projects_list(); - print $cgi->header(-type => 'text/xml', -charset => 'utf-8'); + print $cgi->header( + -type => 'text/xml', + -charset => 'utf-8', + -content_disposition => 'inline; filename="opml.xml"'); + print <