Opened 5 years ago

Closed 4 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


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

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@…, 4 years ago

Made this script;
$rv = json_encode(array('bericht' => 'Dit is een test.','een' => 1,'twee' =>2, 'drie' =>3));
header('Content-Type: application/json');
echo $rv;
browsed it;
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, 4 years ago

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