<commit_before><?php
// Properly handle error logging, as well as a fatal error workaround
require_once(__DIR__ . '/autoload.php');
error_reporting(0);
set_error_handler('errorHandler');
set_exception_handler('exceptionHandler');
register_shutdown_function('fatalErrorShutdownHandler');

$userContext = null;

function handle404() {
    print output(array(
        'message' => "The endpoint '{$_SERVER['REQUEST_URI']}' was not found. Double-check your request and submit again.",
        'uri' => $_SERVER['REQUEST_URI']
    ), 404);
}

function before() {
    $internalUse = \BusinessLogic\Helpers::getHeader('X-INTERNAL-CALL');
<commit_msg>Don't allow non-GET requests in demo mode<commit_after><?php
// Properly handle error logging, as well as a fatal error workaround
require_once(__DIR__ . '/autoload.php');
error_reporting(0);
set_error_handler('errorHandler');
set_exception_handler('exceptionHandler');
register_shutdown_function('fatalErrorShutdownHandler');

$userContext = null;

function handle404() {
    print output(array(
        'message' => "The endpoint '{$_SERVER['REQUEST_URI']}' was not found. Double-check your request and submit again.",
        'uri' => $_SERVER['REQUEST_URI']
    ), 404);
}

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');

{'fraction_non_alphanumeric': 0.14522546419098142, 'fraction_numerical': 0.011273209549071617, 'mean_word_length': 5.0602409638554215, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2040096', 'n_tokens_mistral': 460, 'n_tokens_neox': 440, 'n_words': 111}