tempire / mojolicious-plugin-consolelogger

Show Mojolicious log messages in browser console (firebug, webkit dev tools)
8 stars 5 forks source link

console text is rendered when response is json #3

Open markd-opmantek opened 11 years ago

markd-opmantek commented 11 years ago

To fix this I added this code to the top of the after_dispatch hook:

return if $self->res->headers->content_type eq 'application/json';

It's probably not complete but it does solve my problem.

phillipadsmith commented 10 years ago

/subscribing (same issue)

csroli commented 8 years ago

When the content_type has a charset parameter, this solution doesn't work. I think we must use index($self->res->headers->content_type,'application/json') instead of eq.