{"thread":{"id":"19106","subject":"gitweb sets incorrect <base> header","startedAt":"2009-04-28T12:41:11Z","lastAt":"2009-04-30T10:06:45Z","messageCount":4,"participants":["Peter Simons","Giuseppe Bilotta","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"112516","messageId":"877i15uf14.fsf@write-only.cryp.to","threadId":"19106","inReplyTo":null,"subject":"gitweb sets incorrect <base> header","fromName":"Peter Simons","fromEmail":"simons@cryp.to","sentAt":"2009-04-28T12:41:11Z","receivedAt":"2009-04-28T12:41:11Z","isPatch":false,"sender":{"key":"simons@cryp.to","avatar":"https://gravatar.com/avatar/56227a0fffc05e2d0584aecce45f0f1fd2b2c0a464a266dff6c2a4aa9191241e?d=mp&s=160"},"body":"Hi,\n\nafter a recent gitweb update to revision v1.6.3-rc3-12-gb79376c, the CGI now\ngenerates an incorrect <base> header. For example, the first \"patch\" on the\npage\n\n  http://git.cryp.to/fastcgi/commitdiff/9ad9965b3fa293c458df14391f181f2f8f1197cd\n\nerroneously refer to http://git.cryp.to/cgi-bin/gitweb.cgi#patch1, but that\npage doesn't exist. It appears that $base_url is not determined correctly.\n\nDoes anyone have a clue how that problem can be fixed?\n\nTake care,\nPeter\n"},{"id":"112616","messageId":"gt9685$l9g$1@ger.gmane.org","threadId":"19106","inReplyTo":"877i15uf14.fsf@write-only.cryp.to","subject":"Re: gitweb sets incorrect <base> header","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2009-04-29T09:22:13Z","receivedAt":"2009-04-29T09:22:13Z","isPatch":false,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"On Tuesday 28 April 2009 14:41, Peter Simons wrote:\n> after a recent gitweb update to revision v1.6.3-rc3-12-gb79376c, the CGI now\n> generates an incorrect <base> header. For example, the first \"patch\" on the\n> page\n> \n>   http://git.cryp.to/fastcgi/commitdiff/9ad9965b3fa293c458df14391f181f2f8f1197cd\n> \n> erroneously refer to http://git.cryp.to/cgi-bin/gitweb.cgi#patch1, but that\n\nBoth in Konqueror and Opera the patch link on that page refers to \n\nhttp://git.cryp.to/fastcgi/patch/9ad9965b3fa293c458df14391f181f2f8f1197cd\n\nwhich is quite correct.\n\n> page doesn't exist. It appears that $base_url is not determined correctly.\n> \n> Does anyone have a clue how that problem can be fixed?\n\nOTOH by looking at the source I see\n\n<base href=\"http://git.cryp.to/cgi-bin/gitweb.cgi\" />\n\nwhich doesn't seem correct at all. Do you have something in the gitweb config\nthat may be hard-coding the base url?\n\n-- \nGiuseppe \"Oblomov\" Bilotta\n"},{"id":"112618","messageId":"m3k553oldj.fsf@localhost.localdomain","threadId":"19106","inReplyTo":"877i15uf14.fsf@write-only.cryp.to","subject":"Re: gitweb sets incorrect <base> header","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-04-29T09:33:01Z","receivedAt":"2009-04-29T09:33:01Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Peter Simons <simons@cryp.to> writes:\n\n> Hi,\n> \n> after a recent gitweb update to revision v1.6.3-rc3-12-gb79376c, the CGI now\n> generates an incorrect <base> header. For example, the first \"patch\" on the\n> page\n> \n>   http://git.cryp.to/fastcgi/commitdiff/9ad9965b3fa293c458df14391f181f2f8f1197cd\n> \n> erroneously refer to http://git.cryp.to/cgi-bin/gitweb.cgi#patch1, but that\n> page doesn't exist. It appears that $base_url is not determined correctly.\n> \n> Does anyone have a clue how that problem can be fixed?\n\nSee gitweb/README:\n\n * $my_url, $my_uri\n   Full URL and absolute URL of gitweb script;\n   in earlier versions of gitweb you might have need to set those\n   variables, now there should be no need to do it.\n\nOr you can set up $base_url in your gitweb configuration file (which\nis not mentioned in the gitweb/README, unfortunately).\n\n\nSince 81d3fe9 (gitweb: fix wrong base URL when non-root DirectoryIndex)\nby Giuseppe Bilotta (I have CC-ed him) gitweb tries to set $base_url\nusing $cgi->url(-base => 1) . $ENV{'SCRIPT_NAME'} if we use $path_info,\nand if both $my_url and $my_uri begin with $path_info.\n\nI do not know CGI.pm well enough to think up a better solution, but\nwhen $base_url was introduced I have posted email on git mailing list\nabout slight mismatch between what CGI.pm thinks as absolute URL and\nthe notion of absolute URL and absolute _paths_ in appropriate RFC,\nsee e.g. \n  http://thread.gmane.org/gmane.comp.version-control.git/107344/focus=107437\n  http://thread.gmane.org/gmane.comp.version-control.git/107898/focus=108010\n\nP.S. I didn't look at the site in question.\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"112756","messageId":"87preuzc96.fsf@write-only.cryp.to","threadId":"19106","inReplyTo":"m3k553oldj.fsf@localhost.localdomain","subject":"Re: gitweb sets incorrect <base> header","fromName":"Peter Simons","fromEmail":"simons@cryp.to","sentAt":"2009-04-30T10:06:45Z","receivedAt":"2009-04-30T10:06:45Z","isPatch":false,"sender":{"key":"simons@cryp.to","avatar":"https://gravatar.com/avatar/56227a0fffc05e2d0584aecce45f0f1fd2b2c0a464a266dff6c2a4aa9191241e?d=mp&s=160"},"body":"Hi Jakub,\n\n > Or you can set up $base_url in your gitweb configuration file (which\n > is not mentioned in the gitweb/README, unfortunately).\n\nMy gitweb.conf file is now configured as follows:\n\n  $my_url = \"http://git.cryp.to/\";\n  $my_uri = \"/\";\n  $base_url = $my_uri;\n  [...]\n\nThat seems to do the trick.\n\nThank you for your help,\nPeter\n"}]}