git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Alp Toker <alp@atoker.com>
Date
Jul 9, 2006, 11:18 UTC
Message-ID
<44B0E5F4.3000604@atoker.com>
In-Reply-To
<7vwtanm5eb.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 5 quoted lines
>> 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.
Previous: Junio C Hamano
Message 3 of 3 in “gitweb: Send XHTML as 'application/xhtml+xml' where possible”
  1. gitweb: Send XHTML as 'application/xhtml+xml' where possibleAlp Toker, Jul 9, 2006
  2. Junio C HamanoJul 9, 2006
  3. Alp TokerJul 9, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.