Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.3

Request #16585 Wrong HTTP content-type headers returned
Submitted: 2009-09-09 15:54 UTC
From: kingsquare Assigned: alan_k
Status: Closed Package: Services_JSON (version 1.0.0)
PHP Version: Irrelevant OS: irrelevant
Roadmaps: (Not assigned)    

 [2009-09-09 15:54 UTC] kingsquare (Kingsquare Information Services)
Description: ------------ The wrong HTTP content-type headers are returned (differs from the IETF RFC standards) Test script: --------------- $json = new Services_JSON(); echo $json->encode(array('foo', 'bar')); Expected result: ---------------- content-type header 'application/json' (see Actual result: -------------- content-type header 'application/x-javascript'


 [2009-09-09 19:14 UTC] kingsquare (Kingsquare Information Services)
Why isn't the transfer of headers an optional parameter in encode() ? Now the script returns headers when only using json encoded data in HTML files... ?
 [2009-09-09 21:43 UTC] alan_k (Alan Knowles)
-Status: Open +Status: Closed -Assigned To: +Assigned To: alan_k
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at encodeUnsafe() that sends without the header - the idea is to default to 'safe' behavior unless you explicitly tell it not to...