* gitweb sets incorrect <base> header
@ 2009-04-28 12:41 Peter Simons
2009-04-29 9:22 ` Giuseppe Bilotta
2009-04-29 9:33 ` Jakub Narebski
0 siblings, 2 replies; 4+ messages in thread
From: Peter Simons @ 2009-04-28 12:41 UTC (permalink / raw)
To: git
Hi,
after a recent gitweb update to revision v1.6.3-rc3-12-gb79376c, the CGI now
generates an incorrect <base> header. For example, the first "patch" on the
page
http://git.cryp.to/fastcgi/commitdiff/9ad9965b3fa293c458df14391f181f2f8f1197cd
erroneously refer to http://git.cryp.to/cgi-bin/gitweb.cgi#patch1, but that
page doesn't exist. It appears that $base_url is not determined correctly.
Does anyone have a clue how that problem can be fixed?
Take care,
Peter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gitweb sets incorrect <base> header
2009-04-28 12:41 gitweb sets incorrect <base> header Peter Simons
@ 2009-04-29 9:22 ` Giuseppe Bilotta
2009-04-29 9:33 ` Jakub Narebski
1 sibling, 0 replies; 4+ messages in thread
From: Giuseppe Bilotta @ 2009-04-29 9:22 UTC (permalink / raw)
To: git
On Tuesday 28 April 2009 14:41, Peter Simons wrote:
> after a recent gitweb update to revision v1.6.3-rc3-12-gb79376c, the CGI now
> generates an incorrect <base> header. For example, the first "patch" on the
> page
>
> http://git.cryp.to/fastcgi/commitdiff/9ad9965b3fa293c458df14391f181f2f8f1197cd
>
> erroneously refer to http://git.cryp.to/cgi-bin/gitweb.cgi#patch1, but that
Both in Konqueror and Opera the patch link on that page refers to
http://git.cryp.to/fastcgi/patch/9ad9965b3fa293c458df14391f181f2f8f1197cd
which is quite correct.
> page doesn't exist. It appears that $base_url is not determined correctly.
>
> Does anyone have a clue how that problem can be fixed?
OTOH by looking at the source I see
<base href="http://git.cryp.to/cgi-bin/gitweb.cgi" />
which doesn't seem correct at all. Do you have something in the gitweb config
that may be hard-coding the base url?
--
Giuseppe "Oblomov" Bilotta
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gitweb sets incorrect <base> header
2009-04-28 12:41 gitweb sets incorrect <base> header Peter Simons
2009-04-29 9:22 ` Giuseppe Bilotta
@ 2009-04-29 9:33 ` Jakub Narebski
2009-04-30 10:06 ` Peter Simons
1 sibling, 1 reply; 4+ messages in thread
From: Jakub Narebski @ 2009-04-29 9:33 UTC (permalink / raw)
To: Peter Simons; +Cc: git, Giuseppe Bilotta
Peter Simons <simons@cryp.to> writes:
> Hi,
>
> after a recent gitweb update to revision v1.6.3-rc3-12-gb79376c, the CGI now
> generates an incorrect <base> header. For example, the first "patch" on the
> page
>
> http://git.cryp.to/fastcgi/commitdiff/9ad9965b3fa293c458df14391f181f2f8f1197cd
>
> erroneously refer to http://git.cryp.to/cgi-bin/gitweb.cgi#patch1, but that
> page doesn't exist. It appears that $base_url is not determined correctly.
>
> Does anyone have a clue how that problem can be fixed?
See gitweb/README:
* $my_url, $my_uri
Full URL and absolute URL of gitweb script;
in earlier versions of gitweb you might have need to set those
variables, now there should be no need to do it.
Or you can set up $base_url in your gitweb configuration file (which
is not mentioned in the gitweb/README, unfortunately).
Since 81d3fe9 (gitweb: fix wrong base URL when non-root DirectoryIndex)
by Giuseppe Bilotta (I have CC-ed him) gitweb tries to set $base_url
using $cgi->url(-base => 1) . $ENV{'SCRIPT_NAME'} if we use $path_info,
and if both $my_url and $my_uri begin with $path_info.
I do not know CGI.pm well enough to think up a better solution, but
when $base_url was introduced I have posted email on git mailing list
about slight mismatch between what CGI.pm thinks as absolute URL and
the notion of absolute URL and absolute _paths_ in appropriate RFC,
see e.g.
http://thread.gmane.org/gmane.comp.version-control.git/107344/focus=107437
http://thread.gmane.org/gmane.comp.version-control.git/107898/focus=108010
P.S. I didn't look at the site in question.
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gitweb sets incorrect <base> header
2009-04-29 9:33 ` Jakub Narebski
@ 2009-04-30 10:06 ` Peter Simons
0 siblings, 0 replies; 4+ messages in thread
From: Peter Simons @ 2009-04-30 10:06 UTC (permalink / raw)
To: git; +Cc: Giuseppe Bilotta, Jakub Narebski
Hi Jakub,
> Or you can set up $base_url in your gitweb configuration file (which
> is not mentioned in the gitweb/README, unfortunately).
My gitweb.conf file is now configured as follows:
$my_url = "http://git.cryp.to/";
$my_uri = "/";
$base_url = $my_uri;
[...]
That seems to do the trick.
Thank you for your help,
Peter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-30 10:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-28 12:41 gitweb sets incorrect <base> header Peter Simons
2009-04-29 9:22 ` Giuseppe Bilotta
2009-04-29 9:33 ` Jakub Narebski
2009-04-30 10:06 ` Peter Simons
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).