Skip Menu |

This queue is for tickets about the Catalyst-View-TT-ForceUTF8 CPAN distribution.

Report information
The Basics
Id: 20735
Status: new
Priority: 0/
Queue: Catalyst-View-TT-ForceUTF8

People
Owner: Nobody in particular
Requestors: gsimmons [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.06
Fixed in: (no value)



Subject: Improve STRICT_CONTENT_TYPE handling
process() assumes that if the User-Agent is not Internet Explorer (MSIE), the client can support the 'application/xhtml+xml' content-type and updates the response accordingly. But what if it can't? An alternative is to examine the 'Accept' header in the client's request, to check for XHTML support in the User-Agent: if ($self->config->{STRICT_CONTENT_TYPE}) { my $accept = $c->req->header('Accept') || ''; $c->res->content_type( $accept =~ m#application/xhtml\+xml# ? 'application/xhtml+xml; charset=utf-8' : 'text/html; charset=utf-8' ); } Clients without XHTML support would receive the 'text/html' content-type fallback. In the event IE ever supports 'application/xhtml+xml', these clients would receive the proper content-type, too.