From: Jakub Narebski <jnareb@gmail.com>
To: Nicolas Pitre <nico@cam.org>, git@vger.kernel.org
Cc: James Cloos <cloos+vger-git@jhcloos.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Oleg Verych <olecom@flower.upol.cz>,
Junio C Hamano <junkio@cox.net>,
Li Yang-r58472 <LeoLi@freescale.com>,
rea-git@codelabs.ru, Raimund Bauer <ray@softwarelandschaft.com>,
Alp Toker <alp@atoker.com>
Subject: Re: (Re: gitweb not friendly to firefox?) and unusable in the lynx
Date: Sun, 4 Mar 2007 01:49:44 +0100 [thread overview]
Message-ID: <200703040149.45713.jnareb@gmail.com> (raw)
In-Reply-To: <alpine.LRH.0.82.0703022328460.29426@xanadu.home>
Nicolas Pitre wrote:
> On Sat, 3 Mar 2007, Jakub Narebski wrote:
>
>> Could you check if "application/xhtml+xml" is in "Accept:"
>> HTTP Request Header sent by _your_ lynx, e.g. as seen via
>> http://web-sniffer.net/?url=http://www.kernel.org/git
>
> Accept: text/html, text/plain, application/pdf, application/msword,
> audio/mod, image/*, application/postscript, text/sgml, */*;q=0.01
> [CRLF]
> User-Agent: Lynx/2.8.5rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8b
I'm adding back everybody which participated in this thread...
There are two complications: first, sometimes http://www.kernel.org/git
works with lynx (and links2, and w3m), and sometimes do not. I have
reported lynx working with it, but when I tried to repeat this I got
not understood (by lynx) "application/xhtml+xml" instead of correct
"text/html".
Second, the code responsible for setting correct content type is:
my $content_type;
# require explicit support from the UA if we are to send the page as
# 'application/xhtml+xml', otherwise send it as plain old 'text/html'.
# we have to do this because MSIE sometimes globs '*/*', pretending to
# support xhtml+xml but choking when it gets what it asked for.
if (defined $cgi->http('HTTP_ACCEPT') &&
$cgi->http('HTTP_ACCEPT') =~ m/(,|;|\s|^)application\/xhtml\+xml(,|;|\s|$)/ &&
$cgi->Accept('application/xhtml+xml') != 0) {
$content_type = 'application/xhtml+xml';
} else {
$content_type = 'text/html';
}
As you can see lynx _does not_ include 'application/xhtml+xml' among
accepted content types, and gitweb requires to have it set explicitely
(i.e. having */* is not enough).
BUT I have an idea: this might be caused by the gitweb _used by
kernel.org_. http://www.kernel.org/git says that it use "git web interface
version 1.4.5-rc0.GIT" while using "git core binaries version 1.5.0.1"
which is a bit suspicious... and right so, because IIRC kernel.org uses
caching version of gitweb by John 'Warthog9'
http://www.kernel.org/git/?p=git/warthog9/gitweb.git;a=summary
(I think it should use different identification, perhaps "caching git web
interface", or "git web interface (caching)"). I guess that it caches
too aggresively, caching also HTTP response (including content type).
That of course might not be true, but check if for example
http://repo.or.cz (which also does not run vanilla gitweb, by the way)
also gives the same problems to lynx or w3m.
Oleg Verych wrote:
> On Sat, Mar 03, 2007 at 05:29:22AM -0800, Junio C Hamano wrote:
>>
>> I think the real question is if gitweb output need to be XHTML.
>> If everybody's browser is happier with text/html and we do not
>> have to use things only in xhtml, sending text/html out (both as
>> content-type and the actual contents) feels like the right thing
>> to do from compatibility point of view.
>
> Right XML (XHTML) isn't a tags soup as HTML is, so it's better. But
> "application/xml+xml+xml" is very silly, unless site's content uses
> dynamics, DOM, etc. As far as i can see, gitweb is not going to have
> javascript and such yet (because of compatibility/usability).
It would be nice to AJAX-ize blame view in gitweb (if it is enabled).
> Thus, fixing of http content negotiation is needed, or whatever is
> used in Perl for this.
By the way, the change to use 'application/xhtml+xml' is by Alp Toker,
made in commit f6801d669 with the following explanation:
"The 'text/html' media type [RFC2854] is primarily for HTML, not for
XHTML. In general, this media type is NOT suitable for XHTML."
This patch makes gitweb use content negotiation to conservatively send
pages as Content-Type 'application/xhtml+xml' when the user agent
explicitly claims to support it.
Please discuss it with Alp, if is available.
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2007-03-04 0:47 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-01 10:57 gitweb not friendly to firefox? Li Yang-r58472
2007-03-01 11:34 ` Andy Parkins
2007-03-01 11:54 ` Li Yang-r58472
2007-03-01 11:56 ` Junio C Hamano
2007-03-01 13:34 ` Raimund Bauer
2007-03-01 14:00 ` Eygene Ryabinkin
2007-03-01 14:26 ` Raimund Bauer
2007-03-02 2:28 ` Li Yang-r58472
2007-03-02 4:40 ` Junio C Hamano
2007-03-02 6:47 ` Li Yang-r58472
2007-03-02 6:51 ` Junio C Hamano
2007-03-02 9:36 ` Li Yang-r58472
2007-03-02 10:17 ` Junio C Hamano
2007-03-02 10:27 ` Li Yang-r58472
2007-03-02 16:19 ` (Re: gitweb not friendly to firefox?) and unusable in the lynx Oleg Verych
2007-03-03 2:57 ` Jakub Narebski
2007-03-03 3:25 ` Nicolas Pitre
2007-03-03 3:41 ` Jakub Narebski
2007-03-03 3:49 ` Nicolas Pitre
2007-03-03 3:58 ` Jakub Narebski
2007-03-03 4:34 ` Nicolas Pitre
2007-03-04 0:49 ` Jakub Narebski [this message]
2007-03-04 9:47 ` Uwe Kleine-König
2007-03-03 5:09 ` Nicolas Pitre
2007-03-03 13:04 ` Oleg Verych
2007-03-03 13:25 ` Johannes Schindelin
2007-03-03 13:29 ` Junio C Hamano
2007-03-03 14:19 ` Oleg Verych
2007-03-08 15:31 ` sf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200703040149.45713.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=LeoLi@freescale.com \
--cc=alp@atoker.com \
--cc=cloos+vger-git@jhcloos.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=nico@cam.org \
--cc=olecom@flower.upol.cz \
--cc=ray@softwarelandschaft.com \
--cc=rea-git@codelabs.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.