Docs and fix test
Tomas Doran [Mon, 8 Feb 2010 22:22:17 +0000 (22:22 +0000)]
lib/Catalyst/Controller/REST.pm
t/lib/Test/Serialize/Controller/REST.pm

index 7ffe413..e1de5ff 100644 (file)
@@ -150,6 +150,11 @@ deprecated and you will receive warnings in your log.
 
 If a callback=? parameter is passed, this returns javascript in the form of: $callback($serializedJSON);
 
+Note - this is disabled by default as it can be a security risk if you are unaware.
+
+The usual MIME types for this serialization format are: 'text/javascript', 'application/x-javascript',
+'application/javascript'.
+
 =item * C<text/x-data-dumper> => C<Data::Serializer>
 
 Uses the L<Data::Serializer> module to generate L<Data::Dumper> output.
index 4e7d1ba..5b7c4ec 100644 (file)
@@ -27,6 +27,9 @@ __PACKAGE__->config(
         'text/view'   => [ 'View', 'Simple' ],
         'text/explodingview' => [ 'View', 'Awful' ],
         'text/broken' => 'Broken',
+        'text/javascript', => 'JSONP',
+        'application/x-javascript' => 'JSONP',
+        'application/javascript' => 'JSONP',
     },
 );