From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
To: git@vger.kernel.org
Cc: Jakub Narebski <jnareb@gmail.com>, Petr Baudis <pasky@ucw.cz>,
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Subject: [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri
Date: Sun, 3 Aug 2008 20:02:25 +0200 [thread overview]
Message-ID: <1217786545-30685-1-git-send-email-giuseppe.bilotta@gmail.com> (raw)
This patch (combined with appropriate server configuration) allows usage
of the gitweb CGI script as DirectoryIndex for the server root even when
the pathinfo feature is enabled.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
gitweb/gitweb.perl | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index ba1f71b..9c8bcab 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -26,6 +26,10 @@ our $cgi = new CGI;
our $version = "++GIT_VERSION++";
our $my_url = $cgi->url();
our $my_uri = $cgi->url(-absolute => 1);
+if (my $path_info = $ENV{"PATH_INFO"}) {
+ $my_url =~ s,$path_info$,,;
+ $my_uri =~ s,$path_info$,,;
+}
# core git executable to use
# this can just be "git" if your webserver has a sensible PATH
--
1.5.6.3
next reply other threads:[~2008-08-03 18:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-03 18:02 Giuseppe Bilotta [this message]
2008-08-03 19:10 ` [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri Petr Baudis
-- strict thread matches above, loose matches on Subject: below --
2008-09-03 9:57 gitweb pathinfo improvements Giuseppe Bilotta
2008-09-03 9:57 ` [PATCH] gitweb: action in path with use_pathinfo Giuseppe Bilotta
2008-09-03 9:57 ` [PATCH] gitweb: use_pathinfo filenames start with / Giuseppe Bilotta
2008-09-03 9:57 ` [PATCH] gitweb: parse parent..current syntax from pathinfo Giuseppe Bilotta
2008-09-03 9:57 ` [PATCH] gitweb: use_pathinfo creates parent..current paths Giuseppe Bilotta
2008-09-03 9:57 ` [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri Giuseppe Bilotta
2008-09-29 13:07 Giuseppe Bilotta
2008-09-29 13:39 ` Jakub Narebski
2008-10-02 14:22 ` Petr Baudis
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=1217786545-30685-1-git-send-email-giuseppe.bilotta@gmail.com \
--to=giuseppe.bilotta@gmail.com \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
--cc=pasky@ucw.cz \
/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).