Skip Menu |

This queue is for tickets about the Catalyst-Action-REST CPAN distribution.

Report information
The Basics
Id: 43499
Status: rejected
Priority: 0/
Queue: Catalyst-Action-REST

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

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



Subject: Catalyst::Controller::REST breaks Safari by default.
Stupidly webkit has decided that text/xml and application/xml should take precedence over any of the x?html mimetypes in the Accept headers. This triggers XML::Simple and that's probably not what most people expect or want. It certainly took *me* by surprise. Below is a patch to remove the XML::Simple mapping from the default setup, it can be restored if/when WebKit decides to stop being silly and move text/xml application/xml to the back of the line. diff --git a/trunk/lib/Catalyst/Controller/REST.pm b/trunk/lib/Catalyst/Controller/REST.pm index d0c43b0..3a60097 100644 --- a/trunk/lib/Catalyst/Controller/REST.pm +++ b/trunk/lib/Catalyst/Controller/REST.pm @@ -221,7 +221,6 @@ __PACKAGE__->config( 'stash_key' => 'rest', 'map' => { 'text/html' => 'YAML::HTML', - 'text/xml' => 'XML::Simple', 'text/x-yaml' => 'YAML', 'application/json' => 'JSON', 'text/x-json' => 'JSON',
On Sat Feb 21 17:47:18 2009, PERIGRIN wrote: Show quoted text
> Stupidly webkit has decided that text/xml and application/xml should > take precedence over any of the x?html mimetypes in the Accept headers. > This triggers XML::Simple and that's probably not what most people > expect or want. It certainly took *me* by surprise. > > Below is a patch to remove the XML::Simple mapping from the default > setup, it can be restored if/when WebKit decides to stop being silly and > move text/xml application/xml to the back of the line.
This doesn't really address anything; people who want to use xml presumably still have to worry about how to handle WebKit. Is there any browser-specific workaround you can think of that isn't horrible?
On Wed Mar 25 01:46:03 2009, HDP wrote:. Show quoted text
> This doesn't really address anything; people who want to use xml > presumably still have to worry about how to handle WebKit. Is there any > browser-specific workaround you can think of that isn't horrible?
Unfortunately not really. This seemed like the least worst case scenario. The problem really is that any "default" you chose will be applied to any iPhone, Android, Safari, Chrome, or other webkit based browser first which is probably not what people want. I'm open to having this patch rejected and telling me to go write a Doc Patch that clearly warns that the default setup is broken for Webkit, with an example of a workaround, if you'd prefer. I think internalizing some kind of browser sniffing would be even more broken though.
On Wed Mar 25 17:12:39 2009, PERIGRIN wrote: Show quoted text
> I'm open to having this patch rejected and telling me to go write a Doc > Patch that clearly warns that the default setup is broken for Webkit, > with an example of a workaround, if you'd prefer. I think internalizing > some kind of browser sniffing would be even more broken though.
I dislike this option least. Also, I plan on making it possible to be a little more flexible with content-type choosing, at which point people can work around it themselves with Request::REST::ForBrowsers if they want to. patch me on github, and thanks.
Perhaps put a patch in Catalyst::Request::REST::ForBrowsers that DTRT with WebKit, and then put a doc patch that explains the issue?