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

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

 



Junio C Hamano wrote:
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...

That makes the two of us. Still, it's probably worth not blocking out IE in case the need arises to check up on repositories from internet cafes when on holiday or the like.

+	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;

Indeed, this line is a bit unwieldy. Will break it out.

2. The "by means of a glob" hack needs to be left as a comment
   in the code to say why;

Good plan.

3. Did you really mean to say "ne 0"?

Well spotted. String comparison works, but != would be more sensible.

A revised patch is in the works.
-
: 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]