Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Commit

Permalink
Don't allow non-GET requests in demo mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-koch committed Jun 28, 2017
1 parent 991c5cb commit e8c0291
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit e8c0291

Please sign in to comment.