{"thread":{"id":"7038","subject":"RE: gitweb not friendly to firefox?","startedAt":"2007-03-01T14:00:47Z","lastAt":"2007-03-08T15:31:50Z","messageCount":24,"participants":["Raimund Bauer","Eygene Ryabinkin","Li Yang-r58472","Junio C Hamano","Oleg Verych","Jakub Narebski","Nicolas Pitre","Johannes Schindelin","Uwe Kleine-König","sf"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"35978","messageId":"20070301140046.GM57456@codelabs.ru","threadId":"7038","inReplyTo":"000f01c75c06$555d5e50$0b0aa8c0@abf.local","subject":"Re: gitweb not friendly to firefox?","fromName":"Eygene Ryabinkin","fromEmail":"rea-git@codelabs.ru","sentAt":"2007-03-01T14:00:47Z","receivedAt":"2007-03-01T14:00:47Z","isPatch":false,"sender":{"key":"rea-git@codelabs.ru","avatar":null},"body":"> > Line Number 43, Column 38:<tr><td>author</td><td>Li Yang\n> <LeoLi@freescale.com></td></tr> -------------------------------------^\n> \n> Try to save the output and verify it with some other xml-parser. The\n> \"<LeoLi@freescale.com>\" seems to be the culprit here, since \"@\" is no\n> allowed character for a xml-tag, and there maybe is some html-escaping of\n> the email address missing?\n\nI think that the situation is simpler: <LeoLi@....> is taken as the\nXML/HTML tag and it\n- does not closed anywhere,\n- has the wrong syntax, since \"@\" and \".\" can not live inside the\ntag name if memory serves me right.\n\nThe proper thing is to replace \"<\" with \"&lt;\" and \">\" with \"&gt;\".\n-- \nEygene\n"},{"id":"35977","messageId":"001001c75c0d$a2840600$0b0aa8c0@abf.local","threadId":"7038","inReplyTo":"20070301140046.GM57456@codelabs.ru","subject":"RE: gitweb not friendly to firefox?","fromName":"Raimund Bauer","fromEmail":"ray@softwarelandschaft.com","sentAt":"2007-03-01T14:26:43Z","receivedAt":"2007-03-01T14:26:43Z","isPatch":false,"sender":{"key":"ray@softwarelandschaft.com","avatar":null},"body":"> I think that the situation is simpler: <LeoLi@....> is taken \n> as the XML/HTML tag and it\n> - does not closed anywhere,\n> - has the wrong syntax, since \"@\" and \".\" can not live inside \n> the tag name if memory serves me right.\n> \n> The proper thing is to replace \"<\" with \"&lt;\" and \">\" with \"&gt;\".\n\nYes ... I should learn to write out what I mean and not only hint at it ;-)\n\n-- \nbest regards\n\n  Ray\n"},{"id":"36035","messageId":"989B956029373F45A0B8AF02970818902DA75D@zch01exm26.fsl.freescale.net","threadId":"7038","inReplyTo":"20070301140046.GM57456@codelabs.ru","subject":"RE: gitweb not friendly to firefox?","fromName":"Li Yang-r58472","fromEmail":"leoli@freescale.com","sentAt":"2007-03-02T02:28:55Z","receivedAt":"2007-03-02T02:28:55Z","isPatch":false,"sender":{"key":"leoli@freescale.com","avatar":null},"body":"> -----Original Message-----\n> From: rea-git@codelabs.ru [mailto:rea-git@codelabs.ru]\n> Sent: Thursday, March 01, 2007 10:01 PM\n> To: Raimund Bauer\n> Cc: Li Yang-r58472; git@vger.kernel.org\n> Subject: Re: gitweb not friendly to firefox?\n> \n> > > Line Number 43, Column 38:<tr><td>author</td><td>Li Yang\n> > <LeoLi@freescale.com></td></tr>\n-------------------------------------^\n> >\n> > Try to save the output and verify it with some other xml-parser. The\n> > \"<LeoLi@freescale.com>\" seems to be the culprit here, since \"@\" is\nno\n> > allowed character for a xml-tag, and there maybe is some\nhtml-escaping of\n> > the email address missing?\n> \n> I think that the situation is simpler: <LeoLi@....> is taken as the\n> XML/HTML tag and it\n> - does not closed anywhere,\n> - has the wrong syntax, since \"@\" and \".\" can not live inside the\n> tag name if memory serves me right.\n> \n> The proper thing is to replace \"<\" with \"&lt;\" and \">\" with \"&gt;\".\n\nYes, you are right.  But why gitweb didn't do that for me?  I observed\nthat some early version of gitweb doesn't have this problem.  Is it\npossible that some new change caused this?\n\n- Leo\n"},{"id":"36037","messageId":"7v4pp4ntpo.fsf@assigned-by-dhcp.cox.net","threadId":"7038","inReplyTo":"989B956029373F45A0B8AF02970818902DA75D@zch01exm26.fsl.freescale.net","subject":"Re: gitweb not friendly to firefox?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-02T04:40:51Z","receivedAt":"2007-03-02T04:40:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Li Yang-r58472\" <LeoLi@freescale.com> writes:\n\n>> The proper thing is to replace \"<\" with \"&lt;\" and \">\" with \"&gt;\".\n>\n> Yes, you are right.  But why gitweb didn't do that for me?  I observed\n> that some early version of gitweb doesn't have this problem.  Is it\n> possible that some new change caused this?\n\nIt's very possible.\n"},{"id":"36041","messageId":"989B956029373F45A0B8AF02970818902DA7E4@zch01exm26.fsl.freescale.net","threadId":"7038","inReplyTo":"7v4pp4ntpo.fsf@assigned-by-dhcp.cox.net","subject":"RE: gitweb not friendly to firefox?","fromName":"Li Yang-r58472","fromEmail":"leoli@freescale.com","sentAt":"2007-03-02T06:47:59Z","receivedAt":"2007-03-02T06:47:59Z","isPatch":false,"sender":{"key":"leoli@freescale.com","avatar":null},"body":"> -----Original Message-----\n> From: Junio C Hamano [mailto:junkio@cox.net]\n> Sent: Friday, March 02, 2007 12:41 PM\n> To: Li Yang-r58472\n> Cc: rea-git@codelabs.ru; Raimund Bauer; git@vger.kernel.org\n> Subject: Re: gitweb not friendly to firefox?\n> \n> \"Li Yang-r58472\" <LeoLi@freescale.com> writes:\n> \n> >> The proper thing is to replace \"<\" with \"&lt;\" and \">\" with \"&gt;\".\n> >\n> > Yes, you are right.  But why gitweb didn't do that for me?  I\nobserved\n> > that some early version of gitweb doesn't have this problem.  Is it\n> > possible that some new change caused this?\n> \n> It's very possible.\n\nWell, I had found out that the escapeHTML() is not functioning on my\nserver.  It leaves the \"<\", \">\", \"@\" unchanged.  Does anyone have a clue\nabout it?  I'm using Redhat 9.0 full installation.\n\n- Leo\n"},{"id":"36042","messageId":"7v1wk8i1et.fsf@assigned-by-dhcp.cox.net","threadId":"7038","inReplyTo":"989B956029373F45A0B8AF02970818902DA7E4@zch01exm26.fsl.freescale.net","subject":"Re: gitweb not friendly to firefox?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-02T06:51:06Z","receivedAt":"2007-03-02T06:51:06Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Li Yang-r58472\" <LeoLi@freescale.com> writes:\n\n>> > Yes, you are right.  But why gitweb didn't do that for me?  I\n> observed\n>> > that some early version of gitweb doesn't have this problem.  Is it\n>> > possible that some new change caused this?\n>> \n>> It's very possible.\n>\n> Well, I had found out that the escapeHTML() is not functioning on my\n> server.  It leaves the \"<\", \">\", \"@\" unchanged.  Does anyone have a clue\n> about it?  I'm using Redhat 9.0 full installation.\n\nI am not sure offhand if escapeHTML implementation is wrong or\nthe call site is calling escapeHTML when it should be using some\nother kinds of escape.\n\nThe person who knows about this issue the best, if I have to\nguess, would be Jakub Narebski.\n"},{"id":"36054","messageId":"989B956029373F45A0B8AF02970818902DA81B@zch01exm26.fsl.freescale.net","threadId":"7038","inReplyTo":"7v1wk8i1et.fsf@assigned-by-dhcp.cox.net","subject":"RE: gitweb not friendly to firefox?","fromName":"Li Yang-r58472","fromEmail":"leoli@freescale.com","sentAt":"2007-03-02T09:36:36Z","receivedAt":"2007-03-02T09:36:36Z","isPatch":false,"sender":{"key":"leoli@freescale.com","avatar":null},"body":"Hi Jakub,\n\nProblem sovled, using the following patch.  I'm not an expert of perl,\nso I don't know if it is problem of the gitweb or problem with my perl\nenvironment.  My environment is perl-5.8.0 and perl-CGI-2.81.\n\nSigned-off-by: Li Yang<leoli@freecale.com>\n---\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 653ca3c..8c9a291 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -591,7 +591,7 @@ sub esc_html ($;%) {\n        my %opts = @_;\n\n        $str = to_utf8($str);\n-       $str = escapeHTML($str);\n+       $str = $cgi->escapeHTML($str);\n        if ($opts{'-nbsp'}) {\n                $str =~ s/ /&nbsp;/g;\n        }\n\n\n> -----Original Message-----\n> From: Junio C Hamano [mailto:junkio@cox.net]\n> Sent: Friday, March 02, 2007 2:51 PM\n> To: Li Yang-r58472\n> Cc: rea-git@codelabs.ru; Raimund Bauer; git@vger.kernel.org; Jakub\nNarebski\n> Subject: Re: gitweb not friendly to firefox?\n> \n> \"Li Yang-r58472\" <LeoLi@freescale.com> writes:\n> \n> >> > Yes, you are right.  But why gitweb didn't do that for me?  I\n> > observed\n> >> > that some early version of gitweb doesn't have this problem.  Is\nit\n> >> > possible that some new change caused this?\n> >>\n> >> It's very possible.\n> >\n> > Well, I had found out that the escapeHTML() is not functioning on my\n> > server.  It leaves the \"<\", \">\", \"@\" unchanged.  Does anyone have a\nclue\n> > about it?  I'm using Redhat 9.0 full installation.\n> \n> I am not sure offhand if escapeHTML implementation is wrong or\n> the call site is calling escapeHTML when it should be using some\n> other kinds of escape.\n> \n> The person who knows about this issue the best, if I have to\n> guess, would be Jakub Narebski.\n> \n"},{"id":"36061","messageId":"7vabyweypw.fsf@assigned-by-dhcp.cox.net","threadId":"7038","inReplyTo":"989B956029373F45A0B8AF02970818902DA81B@zch01exm26.fsl.freescale.net","subject":"Re: gitweb not friendly to firefox?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-02T10:17:31Z","receivedAt":"2007-03-02T10:17:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Li Yang-r58472\" <LeoLi@freescale.com> writes:\n\n> Hi Jakub,\n>\n> Problem sovled, using the following patch.  I'm not an expert of perl,\n> so I don't know if it is problem of the gitweb or problem with my perl\n> environment.  My environment is perl-5.8.0 and perl-CGI-2.81.\n>\n> Signed-off-by: Li Yang<leoli@freecale.com>\n> ---\n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 653ca3c..8c9a291 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -591,7 +591,7 @@ sub esc_html ($;%) {\n>         my %opts = @_;\n>\n>         $str = to_utf8($str);\n> -       $str = escapeHTML($str);\n> +       $str = $cgi->escapeHTML($str);\n>         if ($opts{'-nbsp'}) {\n>                 $str =~ s/ /&nbsp;/g;\n>         }\n>\n\nThis is puzzling....\n\n (1) we have two call sites of escapeHTML(), but your patch\n     touches only one.\n\n (2) we do \"use CGI qw(:standard :escapeHTML -nosticky);\"\n     upfront, presumably after doing this when we say\n     escapeHTML() it means the same as CGI::escapeHTML().\n\n (3) we do \"$cgi = new CGI\" upfront.\n\nSo I am wondering how the patch can have any effect...\n\nI am not saying that I do not believe you when you say the patch\nfixes the problem for you.  I just do not understand why and I\nhate not knowing why something works.\n"},{"id":"36063","messageId":"989B956029373F45A0B8AF02970818902DA81D@zch01exm26.fsl.freescale.net","threadId":"7038","inReplyTo":"7vabyweypw.fsf@assigned-by-dhcp.cox.net","subject":"RE: gitweb not friendly to firefox?","fromName":"Li Yang-r58472","fromEmail":"leoli@freescale.com","sentAt":"2007-03-02T10:27:54Z","receivedAt":"2007-03-02T10:27:54Z","isPatch":false,"sender":{"key":"leoli@freescale.com","avatar":null},"body":"> -----Original Message-----\n> From: Junio C Hamano [mailto:junkio@cox.net]\n> Sent: Friday, March 02, 2007 6:18 PM\n> To: Li Yang-r58472\n> Cc: Jakub Narebski; rea-git@codelabs.ru; Raimund Bauer;\ngit@vger.kernel.org\n> Subject: Re: gitweb not friendly to firefox?\n> \n> \"Li Yang-r58472\" <LeoLi@freescale.com> writes:\n> \n> > Hi Jakub,\n> >\n> > Problem sovled, using the following patch.  I'm not an expert of\nperl,\n> > so I don't know if it is problem of the gitweb or problem with my\nperl\n> > environment.  My environment is perl-5.8.0 and perl-CGI-2.81.\n> >\n> > Signed-off-by: Li Yang<leoli@freecale.com>\n> > ---\n> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> > index 653ca3c..8c9a291 100755\n> > --- a/gitweb/gitweb.perl\n> > +++ b/gitweb/gitweb.perl\n> > @@ -591,7 +591,7 @@ sub esc_html ($;%) {\n> >         my %opts = @_;\n> >\n> >         $str = to_utf8($str);\n> > -       $str = escapeHTML($str);\n> > +       $str = $cgi->escapeHTML($str);\n> >         if ($opts{'-nbsp'}) {\n> >                 $str =~ s/ /&nbsp;/g;\n> >         }\n> >\n> \n> This is puzzling....\n> \n>  (1) we have two call sites of escapeHTML(), but your patch\n>      touches only one.\n> \n>  (2) we do \"use CGI qw(:standard :escapeHTML -nosticky);\"\n>      upfront, presumably after doing this when we say\n>      escapeHTML() it means the same as CGI::escapeHTML().\n> \n>  (3) we do \"$cgi = new CGI\" upfront.\n> \n> So I am wondering how the patch can have any effect...\n> \n> I am not saying that I do not believe you when you say the patch\n> fixes the problem for you.  I just do not understand why and I\n> hate not knowing why something works.\n\nHere is the phenomenon I observed. In CGI.pm,\n# Escape HTML -- used internally\n'escapeHTML' => <<'END_OF_FUNC',\nsub escapeHTML {\n         # hack to work around  earlier hacks\n         push @_,$_[0] if @_==1 && $_[0] eq 'CGI';\n         my ($self,$toencode,$newlinestoo) = CGI::self_or_default(@_);\n         return undef unless defined($toencode);\n         return $toencode if ref($self) && !$self->{'escape'};\n         $toencode =~ s{&}{&amp;}gso;\n         $toencode =~ s{<}{&lt;}gso;\n         $toencode =~ s{>}{&gt;}gso;\n         $toencode =~ s{\"}{&quot;}gso;\n         my $latin = uc $self->{'.charset'} eq 'ISO-8859-1' ||\n                     uc $self->{'.charset'} eq 'WINDOWS-1252';\n         if ($latin) {  # bug in some browsers\n                $toencode =~ s{'}{&#39;}gso;\n                $toencode =~ s{\\x8b}{&#8249;}gso;\n                $toencode =~ s{\\x9b}{&#8250;}gso;\n                if (defined $newlinestoo && $newlinestoo) {\n                     $toencode =~ s{\\012}{&#10;}gso;\n                     $toencode =~ s{\\015}{&#13;}gso;\n                }\n         }\n         return $toencode;\n}\nEND_OF_FUNC\n\nThe escapeHTML() returns on \" return $toencode if ref($self) &&\n!$self->{'escape'};\".  So the $self->{'ecscape'} = 0.  However,\n$cgi->{'escape'} = 1.  So I know, the $self is not the $cgi in gitweb,\nbut another CGI with 'escape' undefined.\n\n- Leo\n"},{"id":"36104","messageId":"E1HNATn-0005Y6-HW@flower","threadId":"7038","inReplyTo":"7vabyweypw.fsf@assigned-by-dhcp.cox.net","subject":"(Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Oleg Verych","fromEmail":"olecom@flower.upol.cz","sentAt":"2007-03-02T16:19:35Z","receivedAt":"2007-03-02T16:19:35Z","isPatch":false,"sender":{"key":"olecom@flower.upol.cz","avatar":null},"body":"> From: Junio C Hamano\n> Newsgroups: gmane.comp.version-control.git\n> Subject: Re: gitweb not friendly to firefox?\n> Date: Fri, 02 Mar 2007 02:17:31 -0800\n[]\n>\n> This is puzzling....\n\nHallo.\n\nGuys, changing content to \"application/xhtml+xml\" was a bad idea.\nHere i see FF doesn't working, but i have lynx not working at all :(\n\n\"text/html\" is OK, unless you have shiny modern AJAX sh1t on board...\n____\n"},{"id":"36147","messageId":"200703030357.18822.jnareb@gmail.com","threadId":"7038","inReplyTo":"E1HNATn-0005Y6-HW@flower","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-03-03T02:57:18Z","receivedAt":"2007-03-03T02:57:18Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Oleg Verych wrote:\n>> From: Junio C Hamano\n>> Newsgroups: gmane.comp.version-control.git\n>> Subject: Re: gitweb not friendly to firefox?\n>> Date: Fri, 02 Mar 2007 02:17:31 -0800\n>[]\n>>\n>> This is puzzling....\n> \n> Guys, changing content to \"application/xhtml+xml\" was a bad idea.\n> Here i see FF doesn't working, but i have lynx not working at all :(\n> \n> \"text/html\" is OK, unless you have shiny modern AJAX sh1t on board...\n\nWell, change from text/html to (sometimes) application/xhtml+xml was\nmade in commit f6801d669 by Alp Toker with the following explanation:\n\n    \"The 'text/html' media type [RFC2854] is primarily for HTML, not for\n    XHTML. In general, this media type is NOT suitable for XHTML.\"\n    \n    This patch makes gitweb use content negotiation to conservatively send\n    pages as Content-Type 'application/xhtml+xml' when the user agent\n    explicitly claims to support it.\n\nBy \"conservatively\" it means that it uses 'application/xhtml+xml' only when\nclient explicitly claims that it accepts its, and it is not due to for\nexample */* accept globbing.\n\nSo if lynx isn't working, it is its damn fault...\n-- \nJakub Narebski\nPoland\n"},{"id":"36148","messageId":"alpine.LRH.0.82.0703022223060.29426@xanadu.home","threadId":"7038","inReplyTo":"200703030357.18822.jnareb@gmail.com","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-03-03T03:25:42Z","receivedAt":"2007-03-03T03:25:42Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Sat, 3 Mar 2007, Jakub Narebski wrote:\n\n> By \"conservatively\" it means that it uses 'application/xhtml+xml' only when\n> client explicitly claims that it accepts its, and it is not due to for\n> example */* accept globbing.\n> \n> So if lynx isn't working, it is its damn fault...\n\nI absolutely don't care.\n\nI use lynx, and lynx worked perfectly fine before.  So it is not lynx \nthat broke it.  Please fix gitweb.\n\n\nNicolas\n"},{"id":"36149","messageId":"200703030441.36627.jnareb@gmail.com","threadId":"7038","inReplyTo":"alpine.LRH.0.82.0703022223060.29426@xanadu.home","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-03-03T03:41:35Z","receivedAt":"2007-03-03T03:41:35Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Nicolas Pitre wrote:\n> On Sat, 3 Mar 2007, Jakub Narebski wrote:\n> \n>> By \"conservatively\" it means that it uses 'application/xhtml+xml' only when\n>> client explicitly claims that it accepts its, and it is not due to for\n>> example */* accept globbing.\n>> \n>> So if lynx isn't working, it is its damn fault...\n> \n> I absolutely don't care.\n> \n> I use lynx, and lynx worked perfectly fine before.  So it is not lynx \n> that broke it.  Please fix gitweb.\n\nWORKSFORME.\n\nLynx Version 2.8.5rel.1 (04 Feb 2004)\nlibwww-FM 2.14, SSL-MM 1.4.1, OpenSSL 0.9.7f\n\ngit web interface version 1.5.0.rc3.gc0bbd\n\n(and application/xhtml+xml is _not_ among Accept's).\n-- \nJakub Narebski\nPoland\n"},{"id":"36150","messageId":"alpine.LRH.0.82.0703022242570.29426@xanadu.home","threadId":"7038","inReplyTo":"200703030441.36627.jnareb@gmail.com","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-03-03T03:49:29Z","receivedAt":"2007-03-03T03:49:29Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Sat, 3 Mar 2007, Jakub Narebski wrote:\n\n> Nicolas Pitre wrote:\n> > On Sat, 3 Mar 2007, Jakub Narebski wrote:\n> > \n> >> By \"conservatively\" it means that it uses 'application/xhtml+xml' only when\n> >> client explicitly claims that it accepts its, and it is not due to for\n> >> example */* accept globbing.\n> >> \n> >> So if lynx isn't working, it is its damn fault...\n> > \n> > I absolutely don't care.\n> > \n> > I use lynx, and lynx worked perfectly fine before.  So it is not lynx \n> > that broke it.  Please fix gitweb.\n> \n> WORKSFORME.\n> \n> Lynx Version 2.8.5rel.1 (04 Feb 2004)\n> libwww-FM 2.14, SSL-MM 1.4.1, OpenSSL 0.9.7f\n> \n> git web interface version 1.5.0.rc3.gc0bbd\n> \n> (and application/xhtml+xml is _not_ among Accept's).\n\nThis is Lynx 2.8.5rel.1 (04 Feb 2004) on Fedora Core 6:\n\n$ lynx http://www.kernel.org/git\n[...]\napplication/xhtml+xml  D)ownload, or C)ancel\n\n\nNicolas\n"},{"id":"36151","messageId":"200703030458.58616.jnareb@gmail.com","threadId":"7038","inReplyTo":"alpine.LRH.0.82.0703022242570.29426@xanadu.home","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-03-03T03:58:58Z","receivedAt":"2007-03-03T03:58:58Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"[some Cc dropped]\n\nNicolas Pitre wrote:\n> On Sat, 3 Mar 2007, Jakub Narebski wrote:\n>> Nicolas Pitre wrote:\n>>> On Sat, 3 Mar 2007, Jakub Narebski wrote:\n>>> \n>>>> By \"conservatively\" it means that it uses 'application/xhtml+xml' only when\n>>>> client explicitly claims that it accepts its, and it is not due to for\n>>>> example */* accept globbing.\n>>>> \n>>>> So if lynx isn't working, it is its damn fault...\n>>> \n>>> I absolutely don't care.\n>>> \n>>> I use lynx, and lynx worked perfectly fine before.  So it is not lynx \n>>> that broke it.  Please fix gitweb.\n>> \n>> WORKSFORME.\n>> \n>> Lynx Version 2.8.5rel.1 (04 Feb 2004)\n>> libwww-FM 2.14, SSL-MM 1.4.1, OpenSSL 0.9.7f\n>> \n>> git web interface version 1.5.0.rc3.gc0bbd\n>> \n>> (and application/xhtml+xml is _not_ among Accept's).\n> \n> This is Lynx 2.8.5rel.1 (04 Feb 2004) on Fedora Core 6:\n> \n> $ lynx http://www.kernel.org/git\n> [...]\n> application/xhtml+xml  D)ownload, or C)ancel\n\n$ lynx http://www.kernel.org/git\n[...]\n#                                                          Kernel.org - Git Repo (p1 of 26)\n\n   #Kernel.org - Git Repo projects list Kernel.org - Git Repo projects feeds\n[...]\n\nCould you check if \"application/xhtml+xml\" is in \"Accept:\"\nHTTP Request Header sent by _your_ lynx, e.g. as seen via\n  http://web-sniffer.net/?url=http://www.kernel.org/git\n\n-- \nJakub Narebski\nPoland\n"},{"id":"36152","messageId":"alpine.LRH.0.82.0703022328460.29426@xanadu.home","threadId":"7038","inReplyTo":"200703030458.58616.jnareb@gmail.com","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-03-03T04:34:17Z","receivedAt":"2007-03-03T04:34:17Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Sat, 3 Mar 2007, Jakub Narebski wrote:\n\n> Could you check if \"application/xhtml+xml\" is in \"Accept:\"\n> HTTP Request Header sent by _your_ lynx, e.g. as seen via\n>   http://web-sniffer.net/?url=http://www.kernel.org/git\n\nAccept: text/html, text/plain, application/pdf, application/msword, audio/mod, image/*, application/postscript, text/sgml, */*;q=0.01[CRLF]\nUser-Agent: Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8b \n\n\nNicolas\n"},{"id":"36153","messageId":"alpine.LRH.0.82.0703030005320.29426@xanadu.home","threadId":"7038","inReplyTo":"alpine.LRH.0.82.0703022242570.29426@xanadu.home","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-03-03T05:09:02Z","receivedAt":"2007-03-03T05:09:02Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Fri, 2 Mar 2007, Nicolas Pitre wrote:\n\n> This is Lynx 2.8.5rel.1 (04 Feb 2004) on Fedora Core 6:\n> \n> $ lynx http://www.kernel.org/git\n> [...]\n> application/xhtml+xml  D)ownload, or C)ancel\n\nI also tried with elinks and it works fine.\n\nThen I tried links2 and it gives:\n\n|?? Unknown type \n|????????????????????????????????????????????????????????????????\n|\n|Content type is application/xhtml+xml.\n|Do you want to save or display this file?\n|\n|[ Save ]  [ Display ]  [ Cancel ]\n\nSo gitweb is now broken for 2 out of 3 text based browsers that used to \njust work fine before.\n\n\nNicolas\n"},{"id":"36173","messageId":"20070303130423.GL16509@flower.upol.cz","threadId":"7038","inReplyTo":"alpine.LRH.0.82.0703030005320.29426@xanadu.home","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Oleg Verych","fromEmail":"olecom@flower.upol.cz","sentAt":"2007-03-03T13:04:23Z","receivedAt":"2007-03-03T13:04:23Z","isPatch":false,"sender":{"key":"olecom@flower.upol.cz","avatar":null},"body":"On Sat, Mar 03, 2007 at 12:09:02AM -0500, Nicolas Pitre wrote:\n[]\n> So gitweb is now broken for 2 out of 3 text based browsers that used to \n> just work fine before.\n\nMaybe there's a patch to have xhtml to be as html.\n\nIn the Debian i have:\n\n,-*- bash -*-\n|olecom@flower:/tmp$ nc -l -p 8888 localhost\n|GET / HTTP/1.0\n|Host: localhost:8888\n|Accept: text/html, text/plain, application/x-troff-man,\n|application/x-tar, application/x-gtar, application/ogg, image/gif,\n|image/jpeg, image/pjpeg, image/png, image/tiff, image/bmp, text/*,\n|application/x-debian-package, audio/basic, */*;q=0.01\n|Accept-Encoding: gzip, compress\n|Accept-Language: en, ru, cs\n|Accept-Charset: koi8-r, iso-8859-1;q=0.01, us-ascii;q=0.01\n|User-Agent: Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/1.4.4\n`-*-\n\nAll additional content types, e.g application/*, image/*, are handled by\nexternal software of course.\n\nAnd maybe this: \"*/*;q=0.01\" is handled somehow wrong, i.e out of priority.\n____\n"},{"id":"36175","messageId":"Pine.LNX.4.63.0703031424270.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7038","inReplyTo":"alpine.LRH.0.82.0703030005320.29426@xanadu.home","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-03T13:25:01Z","receivedAt":"2007-03-03T13:25:01Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 3 Mar 2007, Nicolas Pitre wrote:\n\n> On Fri, 2 Mar 2007, Nicolas Pitre wrote:\n> \n> > This is Lynx 2.8.5rel.1 (04 Feb 2004) on Fedora Core 6:\n> > \n> > $ lynx http://www.kernel.org/git\n> > [...]\n> > application/xhtml+xml  D)ownload, or C)ancel\n> \n> I also tried with elinks and it works fine.\n> \n> Then I tried links2 and it gives:\n> \n> |?? Unknown type \n> |????????????????????????????????????????????????????????????????\n> |\n> |Content type is application/xhtml+xml.\n> |Do you want to save or display this file?\n> |\n> |[ Save ]  [ Display ]  [ Cancel ]\n> \n> So gitweb is now broken for 2 out of 3 text based browsers that used to \n> just work fine before.\n\nJust to fuel the fire: w3m also wants to download index.html. It also used \nto work fine before. That makes 3 out of 4.\n\nCiao,\nDscho\n"},{"id":"36176","messageId":"7v3b4mbglp.fsf@assigned-by-dhcp.cox.net","threadId":"7038","inReplyTo":"alpine.LRH.0.82.0703022223060.29426@xanadu.home","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-03T13:29:22Z","receivedAt":"2007-03-03T13:29:22Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nicolas Pitre <nico@cam.org> writes:\n\n> On Sat, 3 Mar 2007, Jakub Narebski wrote:\n>\n>> By \"conservatively\" it means that it uses 'application/xhtml+xml' only when\n>> client explicitly claims that it accepts its, and it is not due to for\n>> example */* accept globbing.\n>> \n>> So if lynx isn't working, it is its damn fault...\n>\n> I absolutely don't care.\n>\n> I use lynx, and lynx worked perfectly fine before.  So it is not lynx \n> that broke it.  Please fix gitweb.\n\nI think the real question is if gitweb output need to be XHTML.\nIf everybody's browser is happier with text/html and we do not\nhave to use things only in xhtml, sending text/html out (both as\ncontent-type and the actual contents) feels like the right thing\nto do from compatibility point of view.\n"},{"id":"36177","messageId":"20070303141947.GN16509@flower.upol.cz","threadId":"7038","inReplyTo":"7v3b4mbglp.fsf@assigned-by-dhcp.cox.net","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Oleg Verych","fromEmail":"olecom@flower.upol.cz","sentAt":"2007-03-03T14:19:47Z","receivedAt":"2007-03-03T14:19:47Z","isPatch":false,"sender":{"key":"olecom@flower.upol.cz","avatar":null},"body":"On Sat, Mar 03, 2007 at 05:29:22AM -0800, Junio C Hamano wrote:\n> Nicolas Pitre <nico@cam.org> writes:\n> \n> > On Sat, 3 Mar 2007, Jakub Narebski wrote:\n> >\n> >> By \"conservatively\" it means that it uses 'application/xhtml+xml' only when\n> >> client explicitly claims that it accepts its, and it is not due to for\n> >> example */* accept globbing.\n> >> \n> >> So if lynx isn't working, it is its damn fault...\n> >\n> > I absolutely don't care.\n> >\n> > I use lynx, and lynx worked perfectly fine before.  So it is not lynx \n> > that broke it.  Please fix gitweb.\n> \n> I think the real question is if gitweb output need to be XHTML.\n> If everybody's browser is happier with text/html and we do not\n> have to use things only in xhtml, sending text/html out (both as\n> content-type and the actual contents) feels like the right thing\n> to do from compatibility point of view.\n> \n\nRight XML (XHTML) isn't a tags soup as HTML is, so it's better. But\n\"application/xml+xml+xml\" is very silly, unless site's content uses\ndynamics, DOM, etc. As far as i can see, gitweb is not going to have\njavascript and such yet (because of compatibility/usability).\n\nThus, fixing of http content negotiation is needed, or whatever is used\nin Perl for this.\n____\n"},{"id":"36221","messageId":"200703040149.45713.jnareb@gmail.com","threadId":"7038","inReplyTo":"alpine.LRH.0.82.0703022328460.29426@xanadu.home","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-03-04T00:49:44Z","receivedAt":"2007-03-04T00:49:44Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Nicolas Pitre wrote:\n> On Sat, 3 Mar 2007, Jakub Narebski wrote:\n> \n>> Could you check if \"application/xhtml+xml\" is in \"Accept:\"\n>> HTTP Request Header sent by _your_ lynx, e.g. as seen via\n>>   http://web-sniffer.net/?url=http://www.kernel.org/git\n> \n> Accept: text/html, text/plain, application/pdf, application/msword,\n>   audio/mod, image/*, application/postscript, text/sgml, */*;q=0.01\n>   [CRLF]    \n> User-Agent: Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8b \n\nI'm adding back everybody which participated in this thread...\n\nThere are two complications: first, sometimes http://www.kernel.org/git\nworks with lynx (and links2, and w3m), and sometimes do not. I have\nreported lynx working with it, but when I tried to repeat this I got\nnot understood (by lynx) \"application/xhtml+xml\" instead of correct\n\"text/html\".\n\nSecond, the code responsible for setting correct content type is:\n\n\tmy $content_type;\n\t# require explicit support from the UA if we are to send the page as\n\t# 'application/xhtml+xml', otherwise send it as plain old 'text/html'.\n\t# we have to do this because MSIE sometimes globs '*/*', pretending to\n\t# support xhtml+xml but choking when it gets what it asked for.\n\tif (defined $cgi->http('HTTP_ACCEPT') &&\n\t    $cgi->http('HTTP_ACCEPT') =~ m/(,|;|\\s|^)application\\/xhtml\\+xml(,|;|\\s|$)/ &&\n\t    $cgi->Accept('application/xhtml+xml') != 0) {\n\t\t$content_type = 'application/xhtml+xml';\n\t} else {\n\t\t$content_type = 'text/html';\n\t}\n\nAs you can see lynx _does not_ include 'application/xhtml+xml' among\naccepted content types, and gitweb requires to have it set explicitely\n(i.e. having */* is not enough).\n\n\nBUT I have an idea: this might be caused by the gitweb _used by\nkernel.org_. http://www.kernel.org/git says that it use \"git web interface\nversion 1.4.5-rc0.GIT\" while using \"git core binaries version 1.5.0.1\"\nwhich is a bit suspicious... and right so, because IIRC kernel.org uses\ncaching version of gitweb by John 'Warthog9'\n  http://www.kernel.org/git/?p=git/warthog9/gitweb.git;a=summary\n(I think it should use different identification, perhaps \"caching git web\ninterface\", or \"git web interface (caching)\"). I guess that it caches\ntoo aggresively, caching also HTTP response (including content type).\n \nThat of course might not be true, but check if for example\nhttp://repo.or.cz (which also does not run vanilla gitweb, by the way)\nalso gives the same problems to lynx or w3m.\n\n\nOleg Verych wrote:\n> On Sat, Mar 03, 2007 at 05:29:22AM -0800, Junio C Hamano wrote:\n>>\n>> I think the real question is if gitweb output need to be XHTML.\n>> If everybody's browser is happier with text/html and we do not\n>> have to use things only in xhtml, sending text/html out (both as\n>> content-type and the actual contents) feels like the right thing\n>> to do from compatibility point of view.\n>\n> Right XML (XHTML) isn't a tags soup as HTML is, so it's better. But\n> \"application/xml+xml+xml\" is very silly, unless site's content uses\n> dynamics, DOM, etc. As far as i can see, gitweb is not going to have\n> javascript and such yet (because of compatibility/usability).\n\nIt would be nice to AJAX-ize blame view in gitweb (if it is enabled).\n\n> Thus, fixing of http content negotiation is needed, or whatever is\n> used in Perl for this.\n\nBy the way, the change to use 'application/xhtml+xml' is by Alp Toker,\nmade in commit f6801d669 with the following explanation:\n\n    \"The 'text/html' media type [RFC2854] is primarily for HTML, not for\n    XHTML. In general, this media type is NOT suitable for XHTML.\"\n    \n    This patch makes gitweb use content negotiation to conservatively send\n    pages as Content-Type 'application/xhtml+xml' when the user agent\n    explicitly claims to support it.\n\nPlease discuss it with Alp, if is available.\n-- \nJakub Narebski\nPoland\n"},{"id":"36231","messageId":"20070304094747.GA6550@informatik.uni-freiburg.de","threadId":"7038","inReplyTo":"200703040149.45713.jnareb@gmail.com","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@informatik.uni-freiburg.de","sentAt":"2007-03-04T09:47:47Z","receivedAt":"2007-03-04T09:47:47Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\nJakub Narebski wrote:\n> There are two complications: first, sometimes http://www.kernel.org/git\n> works with lynx (and links2, and w3m), and sometimes do not.\nwww.kernel.org is provided by 2 machines.  Some time ago I could fetch\nfrom the one but not from the other.  Maybe you want to try to address\nthem explicitly?\n\nBest regards\nUwe\n\n-- \nUwe Kleine-König\n\nhttp://www.google.com/search?q=e+%5E+%28i+pi%29\n"},{"id":"36630","messageId":"45F02C66.9010909@b-i-t.de","threadId":"7038","inReplyTo":"200703030357.18822.jnareb@gmail.com","subject":"Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx","fromName":"sf","fromEmail":"sf@b-i-t.de","sentAt":"2007-03-08T15:31:50Z","receivedAt":"2007-03-08T15:31:50Z","isPatch":false,"sender":{"key":"sf@b-i-t.de","avatar":null},"body":"Jakub Narebski wrote:\n...\n> By \"conservatively\" it means that it uses 'application/xhtml+xml' only when\n> client explicitly claims that it accepts its, and it is not due to for\n> example */* accept globbing.\n\nYou may need something like the (not tested and line wrapped) patch \nbelow as well.\n\nRegards\n\nStephan\n\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 27b5970..6cc5c20 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1714,7 +1714,8 @@ sub git_header_html {\n                 $content_type = 'text/html';\n         }\n         print $cgi->header(-type=>$content_type, -charset => 'utf-8',\n-                          -status=> $status, -expires => $expires);\n+                          -status=> $status, -expires => $expires,\n+                          -Vary=> 'Accept');\n         my $mod_perl_version = $ENV{'MOD_PERL'} ? \" $ENV{'MOD_PERL'}\" : '';\n         print <<EOF;\n  <?xml version=\"1.0\" encoding=\"utf-8\"?>\n"}]}