removed need for checking if video

pull/15/head
tycrek 4 years ago
parent 2341f807bd
commit 10e3ef7ac4
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -108,8 +108,8 @@ function startup() {
// If the ID is invalid, return 404
if (!resourceId || !data[resourceId]) return res.sendStatus(404);
// If a Discord client wants to load an mp4, send the data needed for a proper inline embed
if (req.useragent.isBot /* && data[resourceId].mimetype == 'video/mp4' */) return res.type('html').send(new OpenGraph(getTrueHttp(), getTrueDomain(), resourceId, data[resourceId]).build());
// If the client is Discord, send an Open Graph embed
if (req.useragent.isBot) return res.type('html').send(new OpenGraph(getTrueHttp(), getTrueDomain(), resourceId, data[resourceId]).build());
// Read the file and send it to the client
fs.readFile(path(data[resourceId].path))

Loading…
Cancel
Save