Skip to content

Commit 8e761d4

Browse files
committed
answerJWT error handling add escape quotes
1 parent 964aca4 commit 8e761d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/RenderApp/Controller/Render.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,6 @@ async sub problem {
160160
elsif ($response->is_error) {
161161
$answerJWTresponse->{message} = '[' . $c->logID . '] ' . $response->message;
162162
}
163-
164-
$answerJWTresponse->{message} =~ s/"/\\"/g;
165-
$answerJWTresponse->{message} =~ s/'/\'/g;
166163
})->
167164
catch(sub {
168165
my $response = shift;
@@ -171,6 +168,9 @@ async sub problem {
171168
$answerJWTresponse->{status} = 500;
172169
$answerJWTresponse->{message} = '[' . $c->logID . '] ' . $response;
173170
});
171+
172+
$answerJWTresponse->{message} =~ s/"/\\"/g;
173+
$answerJWTresponse->{message} =~ s/'/\'/g;
174174
$answerJWTresponse = encode_json($answerJWTresponse);
175175
$c->log->info("answerJWT response ".$answerJWTresponse);
176176

0 commit comments

Comments
 (0)