Opened 5 years ago

Closed 5 years ago

#1759 closed defect (invalid)

Closing curly bracket missing on JSON response

Reported by: jchlagrand@… Owned by:
Priority: major Milestone:
Component: other Version: 1.15.x
Keywords: php json Cc:
uname -a: Linux gsosticket_2 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.15.10

Description

JSON response of a php script holds an extra whitespace at the beginning and lacks the closing curly bracket.

{"q27":"0","q46":"2,965","q49":"0","q2":"26","q6":"2","q9":"0","q43":"77","q3":"51","q7":"55","q10":"0","q4":"73","q5":"57","q11":"0","q8":"2,888","q12":"0","q13":"0","q14":"181"
<<<
Changing gzip_min_length to 1 resolves the problem (whitespace still there).
First noticed at nginx version 14.10

Change History (5)

comment:1 by Maxim Dounin, 5 years ago

I would suggest that the problem is incorrect php script output, likely incorrect Content-Length in the response. If you for some reason think that the problem is in nginx, please provide more details.

comment:2 by jchlagrand@…, 5 years ago

I am testing the working of nginx as a server for our osTicket v1.11 system, which uses apache2.4. Thus checking the correct response was easy.

comment:3 by Maxim Dounin, 5 years ago

As previously suggested, if you for some reason think that the problem is in nginx, please provide more details. In particular, debug log or a way to reproduce the problem could help to find out what goes on.

comment:4 by jchlagrand@…, 5 years ago

Made this script;
<?php
$rv = json_encode(array('bericht' => 'Dit is een test.','een' => 1,'twee' =>2, 'drie' =>3));
header('Content-Type: application/json');
echo $rv;
?>
browsed it;
https://testserver/test.php
Came out beautifully. So i will go and bother osTicket.
Thanks for your time mdounin, keep up the good works!

comment:5 by Maxim Dounin, 5 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.