{"thread":{"id":"15702","subject":"[PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri","startedAt":"2008-09-29T13:07:42Z","lastAt":"2008-10-02T14:22:35Z","messageCount":3,"participants":["Giuseppe Bilotta","Jakub Narebski","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"91837","messageId":"1222693662-27426-1-git-send-email-giuseppe.bilotta@gmail.com","threadId":"15702","inReplyTo":null,"subject":"[PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2008-09-29T13:07:42Z","receivedAt":"2008-09-29T13:07:42Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"This patch fixes PATH_INFO handling by removing the relevant part from\n$my_url and $my_uri, thus making it unnecessary to specify them by hand\nin the gitweb configuration.\n\nSigned-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n---\n gitweb/gitweb.perl |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex da474d0..ffe3dbf 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -27,6 +27,13 @@ our $version = \"++GIT_VERSION++\";\n our $my_url = $cgi->url();\n our $my_uri = $cgi->url(-absolute => 1);\n \n+# if we're called with PATH_INFO, we have to strip that\n+# from the URL to find our real URL\n+if (my $path_info = $ENV{\"PATH_INFO\"}) {\n+\t$my_url =~ s,\\Q$path_info\\E$,,;\n+\t$my_uri =~ s,\\Q$path_info\\E$,,;\n+}\n+\n # core git executable to use\n # this can just be \"git\" if your webserver has a sensible PATH\n our $GIT = \"++GIT_BINDIR++/git\";\n-- \n1.5.6.5\n"},{"id":"91838","messageId":"200809291539.09467.jnareb@gmail.com","threadId":"15702","inReplyTo":"1222693662-27426-1-git-send-email-giuseppe.bilotta@gmail.com","subject":"Re: [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-09-29T13:39:08Z","receivedAt":"2008-09-29T13:39:08Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Giuseppe Bilotta wrote:\n\n> This patch fixes PATH_INFO handling by removing the relevant part from\n> $my_url and $my_uri, thus making it unnecessary to specify them by hand\n> in the gitweb configuration.\n> \n> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n\nAcked-by: Jakub Narebski <jnareb@gmail.com>\n\n-- \nJakub Narebski\nPoland\n"},{"id":"92163","messageId":"20081002142235.GO10544@machine.or.cz","threadId":"15702","inReplyTo":"1222693662-27426-1-git-send-email-giuseppe.bilotta@gmail.com","subject":"Re: [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-10-02T14:22:35Z","receivedAt":"2008-10-02T14:22:35Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Mon, Sep 29, 2008 at 03:07:42PM +0200, Giuseppe Bilotta wrote:\n> This patch fixes PATH_INFO handling by removing the relevant part from\n> $my_url and $my_uri, thus making it unnecessary to specify them by hand\n> in the gitweb configuration.\n> \n> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n\nAcked-by: Petr Baudis <pasky@suse.cz>\n"}]}