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