This commit is contained in:
Ashley Graves 2024-10-10 16:51:37 +02:00
parent aa7caab9d3
commit c766c245ec

View file

@ -100,11 +100,18 @@ function proxy(url) {
if (!process.env.IMGPROXY_HOST)
return url;
const auth = {};
if (process.env.IMGPROXY_SALT && process.env.IMGPROXY_KEY) {
Object.assign(auth, {
salt: process.env.IMGPROXY_SALT,
key: process.env.IMGPROXY_KEY
})
}
url = generateImageUrl({
endpoint: process.env.IMGPROXY_HOST,
url: url,
salt: process.env.IMGPROXY_SALT,
key: process.env.IMGPROXY_KEY
...auth
});
return url;
@ -160,7 +167,7 @@ module.exports = {
.setTitle(`Post #${post.id}`)
.setURL(post.postView)
.setDescription(description)
.setImage(post.fileUrl)
.setImage(proxy(post.fileUrl))
.setFooter({
text: footerText,
iconURL: proxy(`https://${post.booru.domain}/favicon.ico`),