implementing media type negotiation (based on language negotiation

logic) in cases both JSON and (X)HTML are being requested, resolving #68
This commit is contained in:
El RIDO
2016-04-08 23:29:44 +02:00
parent 9593ba7039
commit 3a92c940a9
4 changed files with 151 additions and 12 deletions

View File

@@ -151,7 +151,7 @@ class zerobin
// output JSON or HTML
if ($this->_request->isJsonApiCall())
{
header('Content-type: application/json');
header('Content-type: ' . request::MIME_JSON);
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE');
header('Access-Control-Allow-Headers: X-Requested-With, Content-Type');