Re: [PATCH] gitweb: Send XHTML as 'application/xhtml+xml' where possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alp Toker <alp@xxxxxxxxxx> 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"?

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]