File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -656,13 +656,13 @@ sub is_image { shift->{is_image} }
656
656
sub print_response {
657
657
my $self = shift ;
658
658
659
- # thanks to Lukas Rampa for this suggestion
660
- my $content_type = ' text/plain' ;
661
- if ($c -> req-> headers-> header(' Accept' ) =~ qr ( application/json) ) {
662
- $content_type = ' application/json' ;
663
- }
664
-
665
659
if (defined $self -> ctx) {
660
+
661
+ # thanks to Lukas Rampa for this suggestion
662
+ if ($self -> ctx-> req-> headers-> header(' Accept' ) =~ qr ( application/json) ) {
663
+ $content_type = ' application/json' ;
664
+ }
665
+
666
666
$self -> ctx-> stash-> {current_view } = ' ' ;
667
667
$self -> ctx-> res-> content_type(" $content_type ; charset=utf-8" );
668
668
$self -> ctx-> res-> body($self -> output . " " ); # concatenate "" for when there is no output
You can’t perform that action at this time.
0 commit comments