buh
This commit is contained in:
parent
aa7caab9d3
commit
c766c245ec
1 changed files with 10 additions and 3 deletions
|
@ -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`),
|
||||
|
|
Loading…
Reference in a new issue