From: Junio C Hamano <junkio@cox.net>
To: Alp Toker <alp@atoker.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] gitweb: Send XHTML as 'application/xhtml+xml' where possible
Date: Sun, 09 Jul 2006 03:36:28 -0700 [thread overview]
Message-ID: <7vwtanm5eb.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <11524381182709-git-send-email-alp@atoker.com> (Alp Toker's message of "Sun, 09 Jul 2006 10:41:58 +0100")
Alp Toker <alp@atoker.com> writes:
> "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.
Ok.
> It falls back to 'text/html' even if the user agent claims to support
> 'application/xhtml+xml' by means of a glob in order to work around an
> insidious Internet Explorer bug.
I do not care much about IE, but...
> + my $content_type = ($cgi->http('HTTP_ACCEPT') =~ m/(,|;|\s|^)application\/xhtml\+xml(,|;|\s|$)/ && $cgi->Accept('application/xhtml+xml') ne 0) ? 'application/xhtml+xml' : 'text/html';
1. I would prefer something like this to be written with if-else,
not with a conditional expression;
2. The "by means of a glob" hack needs to be left as a comment
in the code to say why;
3. Did you really mean to say "ne 0"?
next prev parent reply other threads:[~2006-07-09 10:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-09 9:41 [PATCH] gitweb: Send XHTML as 'application/xhtml+xml' where possible Alp Toker
2006-07-09 10:36 ` Junio C Hamano [this message]
2006-07-09 11:18 ` Alp Toker
-- strict thread matches above, loose matches on Subject: below --
2006-07-09 14:55 Alp Toker
2006-07-11 10:19 [PATCH] Typo fix Alp Toker
2006-07-11 10:19 ` [PATCH] gitweb: Send XHTML as 'application/xhtml+xml' where possible Alp Toker
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=7vwtanm5eb.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=alp@atoker.com \
--cc=git@vger.kernel.org \
/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 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).