How to change global default content type in Catalyst?

I tried:

  • MyApp / Library / MyApp.pm
__PACKAGE __-> config (
    ...,
    content_type => 'application / xhtml + xml'
);

and even with:

  • MyApp / Library / MyApp / View / HTML.pm
__PACKAGE __-> config (
    ...,
    content_type => 'application / xhtml + xml',
);
+4
source share
1 answer

I would do

$c->response->headers->content_type('text/plain');

at startup YourApp / Controller / Root.pm.

This should be done before any other controller (method) and should give a reasonable default value.

+4
source

All Articles