Removed `.json` in oEmbed URL

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

@ -223,7 +223,7 @@ function startup() {
color: getResourceColor(fileData.opengraph.color || null, fileData.vibrant), color: getResourceColor(fileData.opengraph.color || null, fileData.vibrant),
resourceAttr: { src: getDirectUrl(resourceId) }, resourceAttr: { src: getDirectUrl(resourceId) },
discordUrl: `${getDirectUrl(resourceId)}${getSafeExt(fileData.mimetype)}`, discordUrl: `${getDirectUrl(resourceId)}${getSafeExt(fileData.mimetype)}`,
oembedUrl: `${getTrueHttp()}${getTrueDomain()}/${resourceId}/oembed.json`, oembedUrl: `${getTrueHttp()}${getTrueDomain()}/${resourceId}/oembed`,
ogtype: isVideo ? 'video.other' : 'image', ogtype: isVideo ? 'video.other' : 'image',
urlType: `og:${isVideo ? 'video' : 'image'}`, urlType: `og:${isVideo ? 'video' : 'image'}`,
opengraph: replaceholder(ogs.join('\n'), fileData) opengraph: replaceholder(ogs.join('\n'), fileData)
@ -263,7 +263,7 @@ function startup() {
// oEmbed response for clickable authors/providers // oEmbed response for clickable authors/providers
// https://oembed.com/ // https://oembed.com/
// https://old.reddit.com/r/discordapp/comments/82p8i6/a_basic_tutorial_on_how_to_get_the_most_out_of/ // https://old.reddit.com/r/discordapp/comments/82p8i6/a_basic_tutorial_on_how_to_get_the_most_out_of/
app.get('/:resourceId/oembed.json', (req, res) => { app.get('/:resourceId/oembed', (req, res) => {
const { resourceId } = req.ass; const { resourceId } = req.ass;
// Build the oEmbed object & send the response // Build the oEmbed object & send the response

Loading…
Cancel
Save