Set application/json Content Type header on JSON responses

This commit is contained in:
Patrick Donelan 2008-10-23 23:30:25 +00:00
parent 81b112569a
commit 4e5a3c9e4d

View file

@ -475,6 +475,7 @@ eval{
#$self->session->errorHandler->error($@);
$self->session->errorHandler->error("Returning from loadSurvey");
$session->http->setMimeType('application/json');
return encode_json($return);
}
@ -720,6 +721,7 @@ $self->session->errorHandler->error("-------SurveyEnd $url");
}
}
$self->session->errorHandler->error("-------SurveyEnd $url");
$session->http->setMimeType('application/json');
return encode_json({"type","forward","url",$url});
}
@ -769,6 +771,7 @@ $self->session->errorHandler->error("Question Text is: ".$q->{text});
#$self->session->errorHandler->error(Dumper $section);
my $out = $self->processTemplate($section,$self->get("surveyQuestionsId"));
$session->http->setMimeType('application/json');
return encode_json({"type","displayquestions","section",$section,"questions",$questions,"html",$out});
}