* fix: Use raw route for embedding images.
* fix: there was already a raw link passed 😔
This commit is contained in:
parent
1ddd351242
commit
a7ad58b196
2 changed files with 8 additions and 3 deletions
|
@ -63,13 +63,13 @@ export async function sendUpload(user: User, file: File, raw_link: string, link:
|
|||
thumbnail:
|
||||
isImage && parsed.embed.thumbnail
|
||||
? {
|
||||
url: parsed.url,
|
||||
url: raw_link,
|
||||
}
|
||||
: null,
|
||||
image:
|
||||
isImage && parsed.embed.image
|
||||
? {
|
||||
url: parsed.url,
|
||||
url: raw_link,
|
||||
}
|
||||
: null,
|
||||
},
|
||||
|
|
|
@ -255,7 +255,12 @@ async function handler(req: NextApiReq, res: NextApiRes) {
|
|||
response.files.push(responseUrl);
|
||||
|
||||
if (zconfig.discord?.upload) {
|
||||
await sendUpload(user, fileUpload, `${domain}/r/${invis ? invis.invis : fileUpload.name}`, responseUrl);
|
||||
await sendUpload(
|
||||
user,
|
||||
fileUpload,
|
||||
`${domain}/r/${invis ? invis.invis : encodeURI(fileUpload.name)}`,
|
||||
responseUrl
|
||||
);
|
||||
}
|
||||
|
||||
if (zconfig.exif.enabled && zconfig.exif.remove_gps && fileUpload.mimetype.startsWith('image/')) {
|
||||
|
|
Loading…
Reference in a new issue