<commit_before>'use strict';

var rewrite = require('connect-body-rewrite');

module.exports = function () {
    return rewrite({
        accept: function (res) {
            return res.getHeader('content-type').match(/text\/html/);
        },
        rewrite: function (body) {
            return body.replace(/<html(.*)manifest=(('|").*?\3)(.*)>/, "<html$1$4>");
        }
    });
};<commit_msg>Protect against missing headers.<commit_after>'use strict';

var rewrite = require('connect-body-rewrite');

module.exports = function () {
    return rewrite({
        accept: function (res) {
            return (res.getHeader('content-type') || '').match(/text\/html/);
        },
        rewrite: function (body) {
            return body.replace(/<html(.*)manifest=(('|").*?\3)(.*)>/, "<html$1$4>");
        }
    });
};
{'fraction_non_alphanumeric': 0.21802679658952498, 'fraction_numerical': 0.007308160779537149, 'mean_word_length': 2.5584415584415585, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6728481', 'n_tokens_mistral': 259, 'n_tokens_neox': 250, 'n_words': 44}