<commit_before>var gracie = require('./server'),
    url = require('url'),
    crypto = require('crypto');

var handleRequest = function(req, res, gracieServer) {
    var files, query;
    query = url.parse(req.url, true).query;

    if (typeof(query) === 'undefined' || typeof(query.sources) === 'undefined' || /\.\./.test(query.sources)) {
        res.writeHead(500, {'Content-Type': 'text/plain'});
        res.end("ERROR: Missing or invalid sources parameter.\n");
        return;
    }

    files = query.sources.split(',');
    minify = false;
    if (query.minify) minify = true;
    gracieServer.getContent(files, function(err, response) {
        var hash;
        if (err) {
            res.writeHead(500, {'Content-Type': 'text/plain'});
            res.end("ERROR: " + err + "\n");
        } else {
            if (!response.digest) {
                hash = crypto.createHash('md5');
                hash.update(response.content);
                response.digest = hash.digest(encoding='hex');<commit_msg>Fix issue #6: minify=0 seems to be causing content to still be minified<commit_after>var gracie = require('./server'),
    url = require('url'),
    crypto = require('crypto');

var handleRequest = function(req, res, gracieServer) {
    var files, query;
    query = url.parse(req.url, true).query;

    if (typeof(query) === 'undefined' || typeof(query.sources) === 'undefined' || /\.\./.test(query.sources)) {
        res.writeHead(500, {'Content-Type': 'text/plain'});
        res.end("ERROR: Missing or invalid sources parameter.\n");
        return;
    }

    files = query.sources.split(',');
    minify = false;
    if (query.minify && query.minify === '1') minify = true;
    gracieServer.getContent(files, function(err, response) {
        var hash;
        if (err) {
            res.writeHead(500, {'Content-Type': 'text/plain'});
            res.end("ERROR: " + err + "\n");
        } else {
            if (!response.digest) {
                hash = crypto.createHash('md5');
                hash.update(response.content);
                response.digest = hash.digest(encoding='hex');
{'fraction_non_alphanumeric': 0.1724952741020794, 'fraction_numerical': 0.008034026465028356, 'mean_word_length': 2.4591503267973858, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5472720', 'n_tokens_mistral': 657, 'n_tokens_neox': 624, 'n_words': 139}