<commit_before>import * as express from 'express';

const client: any = require('cheerio-httpcli');
client.headers['User-Agent'] = 'MisskeyBot';
client.referer = false;
client.timeout = 10000;
client.maxDataSize = 1024 * 1024; // 1MiB

import config from './config';

export default function router(app: express.Express): void {
	'use strict';

	app.get(`/subdomain/${config.publicConfig.shieldDomain}/*`, (req, res) => {
		const url = req.path.replace(`/subdomain/${config.publicConfig.shieldDomain}/`, '');
		client.fetch(url).then((result: any) => {
			if (result.error !== undefined && result.error !== null) {
				return res.sendStatus(204);
			}

			const contentType: string = result.response.headers['content-type'];

			if (contentType.indexOf('text/html') !== -1) {
				return res.sendStatus(204);
			}

			res.send(result.response.body);
		});
	});
}<commit_msg>Fix bug<commit_after>import * as express from 'express';

const client: any = require('cheerio-httpcli');
client.headers['User-Agent'] = 'MisskeyBot';
client.referer = false;
client.timeout = 10000;
client.maxDataSize = 1024 * 1024; // 1MiB

import config from './config';

export default function router(app: express.Express): void {
	'use strict';

	app.get(`/subdomain/${config.publicConfig.shieldDomain}/*`, (req, res) => {
		const url = req.path.replace(`/subdomain/${config.publicConfig.shieldDomain}/`, '');
		client.fetch(url).then((result: any) => {
			if (result.error !== undefined && result.error !== null) {
				return res.sendStatus(204);
			} else if (result.response.statusCode !== 200) {
				return res.sendStatus(204);
			}

			const contentType: string = result.response.headers['content-type'];

			if (contentType.indexOf('text/html') !== -1) {
				return res.sendStatus(204);
			}

			res.send(result.response.body);
		}, (err: any) => {
			res.sendStatus(204);
		});
	});
}
{'fraction_non_alphanumeric': 0.18459069020866772, 'fraction_numerical': 0.027287319422150885, 'mean_word_length': 4.20891364902507, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '5483989', 'n_tokens_mistral': 702, 'n_tokens_neox': 599, 'n_words': 122}