git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: Jakub Narebski <jnareb@gmail.com>
Subject: [PATCH (amend)] gitweb: Make use of $PATH_INFO for project parameter
Date: Wed, 21 Jun 2006 17:03:39 +0200	[thread overview]
Message-ID: <11509022191149-git-send-email-jnareb@gmail.com> (raw)
In-Reply-To: <11509012742493-git-send-email-jnareb@gmail.com>

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

  reply	other threads:[~2006-06-21 15:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21 14:47 [PATCH] gitweb: Make use of $PATH_INFO for project parameter Jakub Narebski
2006-06-21 15:03 ` Jakub Narebski [this message]
2006-06-21 15:06 ` Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11509022191149-git-send-email-jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).