projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8205469
)
Fix lazy static route with unknown avatars
author
Chocobozzz
<me@florianbigard.com>
Thu, 22 Aug 2019 12:52:41 +0000
(14:52 +0200)
committer
Chocobozzz
<me@florianbigard.com>
Thu, 22 Aug 2019 12:52:41 +0000
(14:52 +0200)
server/controllers/lazy-static.ts
patch
|
blob
|
history
diff --git
a/server/controllers/lazy-static.ts
b/server/controllers/lazy-static.ts
index 28d2f862a59008f3df9f24c5545e830e170772cd..1ff99e90c2830f76ce98ab2b40d105dcd96c88f0 100644
(file)
--- a/
server/controllers/lazy-static.ts
+++ b/
server/controllers/lazy-static.ts
@@
-44,6
+44,8
@@
async function getAvatar (req: express.Request, res: express.Response) {
}
const avatar = await AvatarModel.loadByName(filename)
+ if (!avatar) return res.sendStatus(404)
+
if (avatar.onDisk === false) {
if (!avatar.fileUrl) return res.sendStatus(404)