<commit_before>function domain(domains) {
    return function(req, res, next) {
        let domain_uuid = req.get("domain_uuid") || Object.keys(domains)[0];
        req.domain = domains[domain_uuid];
        next();
    }
}

module.exports = { domain };<commit_msg>incoming requests for unknown domains don't break server anymore<commit_after>function domain(domains) {
    return function(req, res, next) {
        let domain_uuid = req.get("domain_uuid") || Object.keys(domains)[0];
        req.domain = domains[domain_uuid] || {
            uuid: domain_uuid,
            tags:[],
            files: []
        };
        next();
    }
}

module.exports = { domain };
{'fraction_non_alphanumeric': 0.14029850746268657, 'fraction_numerical': 0.0029850746268656717, 'mean_word_length': 2.6666666666666665, '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': '6913511', 'n_tokens_mistral': 199, 'n_tokens_neox': 193, 'n_words': 42}