From 3a60332bdf0fde15eb7d22cabcecbd7f83428e89 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Sat, 29 Oct 2022 02:08:21 +0000 Subject: [PATCH] remove extension check --- discord_embed/api/post.mjs | 16 ++++------------ discord_embed/package.json | 2 +- discord_embed/public/index.html | 2 +- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/discord_embed/api/post.mjs b/discord_embed/api/post.mjs index 6a7543e..839d239 100644 --- a/discord_embed/api/post.mjs +++ b/discord_embed/api/post.mjs @@ -23,10 +23,8 @@ export default class IndexPost { return 'Missing video link' } - if (!ctx.req.body.video.startsWith('http') - || !(ctx.req.body.video.includes('mp4') - || ctx.req.body.video.includes('webm'))) { - return 'Video link has to be a valid full url and contain mp4 or webm in it' + if (!ctx.req.body.video.startsWith('http')) { + return 'Video link has to be a valid full url' } if (!ctx.req.body.image && !hasMedia) { @@ -34,14 +32,8 @@ export default class IndexPost { } if (ctx.req.body.image) { - if (!ctx.req.body.image.startsWith('http') - || !(ctx.req.body.image.includes('jpg') - || ctx.req.body.image.includes('jpeg') - || ctx.req.body.image.includes('webp') - || ctx.req.body.image.includes('png') - ) - ) { - return 'Image link has to be a valid full url and contain jpg, jpeg, webp or png' + if (!ctx.req.body.image.startsWith('http')) { + return 'Image link has to be a valid full url' } } } diff --git a/discord_embed/package.json b/discord_embed/package.json index 46b80d3..cd3dc77 100644 --- a/discord_embed/package.json +++ b/discord_embed/package.json @@ -1,6 +1,6 @@ { "name": "discord_embed", - "version": "1.0.3", + "version": "1.0.4", "port": 4120, "description": "AV1 discord server embed helper", "main": "index.js", diff --git a/discord_embed/public/index.html b/discord_embed/public/index.html index 483690b..547738f 100644 --- a/discord_embed/public/index.html +++ b/discord_embed/public/index.html @@ -2,7 +2,7 @@ - Discord Embedder from AV1 server + Discord Embedder from AV1 server 1.0.4 {{ if (imageLink) { }}