* [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri
@ 2008-08-03 18:02 Giuseppe Bilotta
2008-08-03 19:10 ` Petr Baudis
0 siblings, 1 reply; 6+ messages in thread
From: Giuseppe Bilotta @ 2008-08-03 18:02 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski, Petr Baudis, Giuseppe Bilotta
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri
2008-08-03 18:02 [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri Giuseppe Bilotta
@ 2008-08-03 19:10 ` Petr Baudis
0 siblings, 0 replies; 6+ messages in thread
From: Petr Baudis @ 2008-08-03 19:10 UTC (permalink / raw)
To: Giuseppe Bilotta; +Cc: git, Jakub Narebski
On Sun, Aug 03, 2008 at 08:02:25PM +0200, Giuseppe Bilotta wrote:
> 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>
Acked-by: Petr Baudis <pasky@suse.cz>
(In case anyone is wondering, on repo.or.cz I used to just override
$my_uri manually from the config file.)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri
2008-09-03 9:57 ` [PATCH] gitweb: use_pathinfo creates parent..current paths Giuseppe Bilotta
@ 2008-09-03 9:57 ` Giuseppe Bilotta
0 siblings, 0 replies; 6+ messages in thread
From: Giuseppe Bilotta @ 2008-09-03 9:57 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski, Petr Baudis, Lea Wiemann, Giuseppe Bilotta
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 573b416..99c891e 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.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri
@ 2008-09-29 13:07 Giuseppe Bilotta
2008-09-29 13:39 ` Jakub Narebski
2008-10-02 14:22 ` Petr Baudis
0 siblings, 2 replies; 6+ messages in thread
From: Giuseppe Bilotta @ 2008-09-29 13:07 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski, Junio C Hamano, Shawn O. Pearce, Giuseppe Bilotta
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri
2008-09-29 13:07 Giuseppe Bilotta
@ 2008-09-29 13:39 ` Jakub Narebski
2008-10-02 14:22 ` Petr Baudis
1 sibling, 0 replies; 6+ messages in thread
From: Jakub Narebski @ 2008-09-29 13:39 UTC (permalink / raw)
To: Giuseppe Bilotta; +Cc: git, Shawn O. Pearce
Giuseppe Bilotta wrote:
> 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>
Acked-by: Jakub Narebski <jnareb@gmail.com>
--
Jakub Narebski
Poland
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri
2008-09-29 13:07 Giuseppe Bilotta
2008-09-29 13:39 ` Jakub Narebski
@ 2008-10-02 14:22 ` Petr Baudis
1 sibling, 0 replies; 6+ messages in thread
From: Petr Baudis @ 2008-10-02 14:22 UTC (permalink / raw)
To: Giuseppe Bilotta; +Cc: git, Jakub Narebski, Junio C Hamano, Shawn O. Pearce
On Mon, Sep 29, 2008 at 03:07:42PM +0200, Giuseppe Bilotta wrote:
> 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>
Acked-by: Petr Baudis <pasky@suse.cz>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-10-02 14:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-03 18:02 [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri Giuseppe Bilotta
2008-08-03 19:10 ` 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
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).