Browse Source

Don't allow non-GET requests in demo mode

tags/3.1.0^0
Mike Koch 2 years ago
parent
commit
e8c029186e
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      api/index.php

+ 5
- 0
api/index.php View File

@@ -16,6 +16,11 @@ function handle404() {
}

function before() {
if (defined('HESK_DEMO') && $_SERVER['REQUEST_METHOD'] !== 'GET') {
print_error('Demo Mode', 'Only read-only commands are available in demo mode!', null, 401);
die();
}

$internalUse = \BusinessLogic\Helpers::getHeader('X-INTERNAL-CALL');

if ($internalUse === 'true') {

Loading…
Cancel
Save