aboutsummaryrefslogtreecommitdiff
path: root/p/api/query.php
diff options
context:
space:
mode:
Diffstat (limited to 'p/api/query.php')
-rw-r--r--p/api/query.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/p/api/query.php b/p/api/query.php
index 8fe3c44b0..fff48503e 100644
--- a/p/api/query.php
+++ b/p/api/query.php
@@ -159,6 +159,15 @@ if ($query->getName() != '') {
}
FreshRSS_Context::systemConf()->allow_anonymous = true;
+header('Access-Control-Allow-Methods: GET');
+header('Access-Control-Allow-Origin: *');
+header('Access-Control-Max-Age: 600');
+header('Cache-Control: public, max-age=60');
+if (($_SERVER['REQUEST_METHOD'] ?? '') === 'OPTIONS') {
+ header('HTTP/1.1 204 No Content');
+ exit();
+}
+
if (in_array($format, ['rss', 'atom'], true)) {
header('Content-Type: application/rss+xml; charset=utf-8');
$view->_layout(null);