cool user agent detection thing for discords shitty devs

pull/12/head
tycrek 3 years ago
parent a62a9bf49f
commit bdd58ad6c4
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -65,7 +65,7 @@ function startup() {
// View file
app.get('/:resourceId', (req, res) => {
log(req.useragent);
log('Is bot: ' + (req.useragent.isBot == 'discordbot'));
let resourceId = req.params.resourceId.split('.')[0];
if (data[resourceId] && data[resourceId].mimetype == 'video/mp4' && req.params.resourceId.split('.')[1] != 'mp4') return res.redirect(req.url + '.mp4');
let fileData = fs.readFileSync(path(data[resourceId].path));

Loading…
Cancel
Save