<commit_before><?php

$pos = strpos($_SERVER['REQUEST_URI'], '?');
$file = $pos === false ? $_SERVER['REQUEST_URI'] : substr($_SERVER['REQUEST_URI'], 0, $pos);

if (is_file('.' . $file)) {
    if (preg_match('/.*\.php$/', $file)) {
        header('Content-Type: text/html; charset=utf-8');
        include '.' . $file;
    } else if (preg_match('/.*\.js$/', $file)) {
        header('Content-Type: application/javascript');
        echo file_get_contents('.' . $file);
    } else if (preg_match('/.*\.css$/', $file)) {
        header('Content-Type: text/css');
        echo file_get_contents('.' . $file);
    } else {
        echo file_get_contents('.' . $file);
    }
    exit;
}<commit_msg>MIME-type for demo files<commit_after><?php

$pos = strpos($_SERVER['REQUEST_URI'], '?');
$file = $pos === false ? $_SERVER['REQUEST_URI'] : substr($_SERVER['REQUEST_URI'], 0, $pos);

if (strpos($file, '..') !== false)
    die('Bad request');

if (is_file('.' . $file)) {
    if (preg_match('/.*\.php$/', $file)) {
        header('Content-Type: text/html; charset=utf-8');
        include '.' . $file;
    } else if (preg_match('/.*\.js$/', $file)) {
        header('Content-Type: application/javascript');
        echo file_get_contents('.' . $file);
    } else if (preg_match('/.*\.css$/', $file)) {
        header('Content-Type: text/css');
        echo file_get_contents('.' . $file);
    } else {
        header('Content-Type: ' . exec('file --mime-type ' + escapeshellarg($file)));
        echo file_get_contents('.' . $file);
    }
    exit;
}
{'fraction_non_alphanumeric': 0.23849643551523006, 'fraction_numerical': 0.002592352559948153, 'mean_word_length': 2.879396984924623, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6385921', 'n_tokens_mistral': 542, 'n_tokens_neox': 524, 'n_words': 100}