<commit_before><commit_msg>Added response-time filter<commit_after>/*!
 * Ext JS Connect 0.0.1
 * Copyright(c) 2010 Ext JS, Inc.
 * MIT Licensed
 */

/**
 * Responds with the "X-Response-Time" header.
 */

exports.handle = function(req, res, next){
    var start = new Date,
        writeHead = res.writeHead;

    res.writeHead = function(code, headers){
        headers['X-Response-Time'] = ((new Date - start) / 1000).toFixed(6);
        return writeHead.call(res, code, headers);
    }

    next(req, res);
}
{'fraction_non_alphanumeric': 0.154296875, 'fraction_numerical': 0.0234375, 'mean_word_length': 2.9767441860465116, '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': '4537053', 'n_tokens_mistral': 178, 'n_tokens_neox': 165, 'n_words': 43}