module.exports.scrubTheDub = function (req, res) { // hack for bricked app-cache // Also 301 redirects will not work for appcache (must issue html) if (require('./unbrick-appcache').unbrick(req, res)) { return; } // TODO port number for non-443 var escapeHtml = require('escape-html'); var newLocation = 'https://' + req.hostname.replace(/^www\./, '') + req.url; var safeLocation = escapeHtml(newLocation); var metaRedirect = '' + '\n' + '\n' + ' \n' + ' \n' + '\n' + '\n' + '

You requested an old resource. Please use this instead: \n' + ' ' + safeLocation + '

\n' + '\n' + '\n' ; res.end(metaRedirect); };