git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb: Make use of $PATH_INFO for project parameter
@ 2006-06-21 14:47 Jakub Narebski
  2006-06-21 15:03 ` [PATCH (amend)] " Jakub Narebski
  2006-06-21 15:06 ` [PATCH] " Jakub Narebski
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Narebski @ 2006-06-21 14:47 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski

Allow to have project name in the path part of URL, just after the name of
script. For example instead of gitweb.cgi?p=git.git you can write
gitweb.cgi/git.git or gitweb.cgi/git.git/

Not used in URLs inside gitweb; it means that the above alternate syntax
must be generated by hand, at least for now.

Side effect: project name parameter is now stripped of leading and
trailing slash before validation.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>

---

 gitweb/gitweb.cgi |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

51faac72f83777ced3d9d3544cc6d47431d1b8ee
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index e044c61..91698df 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -86,7 +86,8 @@ if (defined $order) {
 	}
 }
 
-my $project = $cgi->param('p');
+my $project = ($cgi->param('p') || $ENV{'PATH_INFO'});
+$project =~ s|^/||; $project =~ s|/$||;
 if (defined $project) {
 	$project = validate_input($project);
 	if (!defined($project)) {
-- 
1.3.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH (amend)] gitweb: Make use of $PATH_INFO for project parameter
  2006-06-21 14:47 [PATCH] gitweb: Make use of $PATH_INFO for project parameter Jakub Narebski
@ 2006-06-21 15:03 ` Jakub Narebski
  2006-06-21 15:06 ` [PATCH] " Jakub Narebski
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Narebski @ 2006-06-21 15:03 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski

Allow to have project name in the path part of URL, just after the name of
script. For example instead of gitweb.cgi?p=git.git you can write
gitweb.cgi/git.git or gitweb.cgi/git.git/

Not used in URLs inside gitweb; it means that the above alternate syntax
must be generated by hand, at least for now.

Side effect: project name parameter is now stripped of leading and
trailing slash before validation.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>

---

 gitweb/gitweb.cgi |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

63ffc79283d23aeedbdc259e3b069f1e97498e09
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index e044c61..91698df 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -86,7 +86,8 @@ if (defined $order) {
 	}
 }
 
-my $project = $cgi->param('p');
+my $project = ($cgi->param('p') || $ENV{'PATH_INFO'});
+$project =~ s|^/||; $project =~ s|/$||;
 if (defined $project) {
 	$project = validate_input($project);
 	if (!defined($project)) {
-- 
1.3.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] gitweb: Make use of $PATH_INFO for project parameter
  2006-06-21 14:47 [PATCH] gitweb: Make use of $PATH_INFO for project parameter Jakub Narebski
  2006-06-21 15:03 ` [PATCH (amend)] " Jakub Narebski
@ 2006-06-21 15:06 ` Jakub Narebski
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Narebski @ 2006-06-21 15:06 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski

Allow to have project name in the path part of URL, just after the name of
script. For example instead of gitweb.cgi?p=git.git you can write
gitweb.cgi/git.git or gitweb.cgi/git.git/

Not used in URLs inside gitweb; it means that the above alternate syntax
must be generated by hand, at least for now.

Side effect: project name parameter is now stripped of leading and
trailing slash before validation.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>

---
This is final, correct version of the patch.

 gitweb/gitweb.cgi |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

b9df055ae8d3aafe03744537026823dbaf7342ba
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index e044c61..e2108de 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -86,8 +86,9 @@ if (defined $order) {
 	}
 }
 
-my $project = $cgi->param('p');
+my $project = ($cgi->param('p') || $ENV{'PATH_INFO'});
 if (defined $project) {
+	$project =~ s|^/||; $project =~ s|/$||;
 	$project = validate_input($project);
 	if (!defined($project)) {
 		die_error(undef, "Invalid project parameter.");
-- 
1.3.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-06-21 15:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-21 14:47 [PATCH] gitweb: Make use of $PATH_INFO for project parameter Jakub Narebski
2006-06-21 15:03 ` [PATCH (amend)] " Jakub Narebski
2006-06-21 15:06 ` [PATCH] " Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).