Skip Menu |

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

Report information
The Basics
Id: 54737
Status: rejected
Priority: 0/
Queue: Catalyst-View-JSON

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

Bug Information
Severity: Important
Broken in: 0.26
Fixed in: (no value)



Subject: Charset encoding problem in Opera 10
new version of Opera doesn't like "application/x-javascript" MIME type. It causes encoding problems during Ajax requests. Here is the patch to fix it: lib/Catalyst/View/JSON.pm 99c99 < if (($c->req->user_agent || '') =~ /Opera/) { --- Show quoted text
> if (($c->req->user_agent || '') =~ /Opera/ &&
($c->req->header('Accept') || '') !~ /application\/json/) {
From: ryan [...] siew.ca
Opera 10.10 (Currently the latest stable version for 64bit-Linux) does not send Accept:application/json This means that this patch will not work. Content-Type:application/x-javascript will still be sent and things will still be broken in Opera. The same thing happens with Opera 10.53b1 (The latest unstable version for 64bit-Linux) If older versions of Opera really require it then maybe do a version check before sending "Content-Type:application/x-javascript" ? On Thu Feb 18 02:38:22 2010, NUCLON wrote: Show quoted text
> new version of Opera doesn't like "application/x-javascript" MIME type. > It causes encoding problems during Ajax requests. > > Here is the patch to fix it: > > lib/Catalyst/View/JSON.pm > 99c99 > < if (($c->req->user_agent || '') =~ /Opera/) { > ---
> > if (($c->req->user_agent || '') =~ /Opera/ &&
> ($c->req->header('Accept') || '') !~ /application\/json/) {
Not sure how much an issue this is with any modern version of Opera. My recommendation is to do any user agent sniffing and compatibility in the middleware. I don't see checks like this in any other JSON encoder in other popular frameworks, so I'm going to pass.