Short version: what's the protocol in a MyApp::View::Blah to override
content-type in certain circumstances?

Long version:

We're trying to get the blueimp file-upload jQuery library working under IE
(fine under firefox and chrome, of course):
https://github.com/blueimp/jQuery-File-Upload/wiki/Setup

The recommendation is that the server should set content-type to text/html
or text/plain instead of application/json for IE. Here's the PHP example
they post:

<?php
header('Vary: Accept');
if (isset($_SERVER['HTTP_ACCEPT']) &&
    (strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false)) {
    header('Content-type: application/json');
} else {
    header('Content-type: text/plain');
}
?>

What's required in MyApp::View::JSON to handle this properly?


-- 
"We act as though comfort and luxury were the chief requirements of life,
when all that we need to make us happy is something to be enthusiastic
about." -- Albert Einstein
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to