diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2021-07-08 17:43:51 +0100 |
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2021-07-08 17:43:51 +0100 |
| commit | ef36a72e7d0735cb299fdf69e63614c48a855bfa (patch) | |
| tree | 208acd3720165a36ebf34ec867ce573733dce29a /public | |
| parent | 5f58f7e509a07219a30cc8a831f2e5d1bcd83a10 (diff) | |
Allow cors in bookmarklet
Diffstat (limited to 'public')
| -rw-r--r-- | public/bookmarks/add/index.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/public/bookmarks/add/index.php b/public/bookmarks/add/index.php index 7df8ced..835fa64 100644 --- a/public/bookmarks/add/index.php +++ b/public/bookmarks/add/index.php @@ -2,10 +2,18 @@ error_reporting(E_ALL); + require_once(__DIR__.'/../../../includes/functions.php'); $config = require_once(__DIR__.'/../../../config.php'); +if ('OPTIONS' === filter_input(INPUT_SERVER, 'REQUEST_METHOD')) { + respondAndExit(200, 'OK', [ + 'Access-Control-Allow-Methods: POST', + 'Access-Control-Allow-Headers: Content-Type, Authorization', + ]); +} + if ('POST' !== filter_input(INPUT_SERVER, 'REQUEST_METHOD')) { respondAndExit(405, 'Method Not Allowed'); } |
