diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2025-06-03 16:57:15 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2025-06-03 16:57:15 +0300 |
| commit | 87fb1de91dda98c3deeb89b2c58548d5d8c4faf6 (patch) | |
| tree | fcc415f1ad6eaa94f8be2e3fe3a0c8c178f6abfe /classes/Handler_Public.php | |
| parent | 20950525216a45565953004f785ebbcbdded31b9 (diff) | |
| parent | 34c7e11d84059136ac8f526a6e179b29e62c6025 (diff) | |
Merge branch 'feature/json-mime-type' into 'master'
Use the official JSON MIME type of 'application/json'
See merge request tt-rss/tt-rss!146
Diffstat (limited to 'classes/Handler_Public.php')
| -rw-r--r-- | classes/Handler_Public.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/classes/Handler_Public.php b/classes/Handler_Public.php index 36820ab13..347a38381 100644 --- a/classes/Handler_Public.php +++ b/classes/Handler_Public.php @@ -248,7 +248,7 @@ class Handler_Public extends Handler { array_push($feed['articles'], $article); } - header("Content-Type: text/json; charset=utf-8"); + header("Content-Type: application/json; charset=utf-8"); print json_encode($feed); } else { @@ -320,7 +320,7 @@ class Handler_Public extends Handler { header("Location: " . $redirect_url); } else { - header("Content-Type: text/json"); + header("Content-Type: application/json"); print Errors::to_json(Errors::E_UNAUTHORIZED); } } @@ -806,17 +806,17 @@ class Handler_Public extends Handler { $plugin->$method(); } else { user_error("PluginHandler[PUBLIC]: Requested private method '$method' of plugin '$plugin_name'.", E_USER_WARNING); - header("Content-Type: text/json"); + header("Content-Type: application/json"); print Errors::to_json(Errors::E_UNAUTHORIZED); } } else { user_error("PluginHandler[PUBLIC]: Requested unknown method '$method' of plugin '$plugin_name'.", E_USER_WARNING); - header("Content-Type: text/json"); + header("Content-Type: application/json"); print Errors::to_json(Errors::E_UNKNOWN_METHOD); } } else { user_error("PluginHandler[PUBLIC]: Requested method '$method' of unknown plugin '$plugin_name'.", E_USER_WARNING); - header("Content-Type: text/json"); + header("Content-Type: application/json"); print Errors::to_json(Errors::E_UNKNOWN_PLUGIN, ['plugin' => $plugin_name]); } } |