From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
To: git@vger.kernel.org
Cc: Jakub Narebski <jnareb@gmail.com>,
Junio C Hamano <gitster@pobox.com>,
"Shawn O. Pearce" <spearce@spearce.org>,
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Subject: [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri
Date: Mon, 29 Sep 2008 15:07:42 +0200 [thread overview]
Message-ID: <1222693662-27426-1-git-send-email-giuseppe.bilotta@gmail.com> (raw)
This patch fixes PATH_INFO handling by removing the relevant part from
$my_url and $my_uri, thus making it unnecessary to specify them by hand
in the gitweb configuration.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
gitweb/gitweb.perl | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index da474d0..ffe3dbf 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -27,6 +27,13 @@ our $version = "++GIT_VERSION++";
our $my_url = $cgi->url();
our $my_uri = $cgi->url(-absolute => 1);
+# if we're called with PATH_INFO, we have to strip that
+# from the URL to find our real URL
+if (my $path_info = $ENV{"PATH_INFO"}) {
+ $my_url =~ s,\Q$path_info\E$,,;
+ $my_uri =~ s,\Q$path_info\E$,,;
+}
+
# core git executable to use
# this can just be "git" if your webserver has a sensible PATH
our $GIT = "++GIT_BINDIR++/git";
--
1.5.6.5
next reply other threads:[~2008-09-29 13:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-29 13:07 Giuseppe Bilotta [this message]
2008-09-29 13:39 ` [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri Jakub Narebski
2008-10-02 14:22 ` 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-08-03 18:02 Giuseppe Bilotta
2008-08-03 19:10 ` 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=1222693662-27426-1-git-send-email-giuseppe.bilotta@gmail.com \
--to=giuseppe.bilotta@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jnareb@gmail.com \
--cc=spearce@spearce.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).