Skip to content

Commit 5d940a7

Browse files
committed
fixed issue with $c in print_response
1 parent d3b8801 commit 5d940a7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/jQuery/File/Upload.pm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -656,13 +656,13 @@ sub is_image { shift->{is_image} }
656656
sub print_response {
657657
my $self = shift;
658658

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-
665659
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+
666666
$self->ctx->stash->{current_view} = '';
667667
$self->ctx->res->content_type("$content_type; charset=utf-8");
668668
$self->ctx->res->body($self->output . ""); #concatenate "" for when there is no output

0 commit comments

Comments
 (0)