forked from Mirrors/gomuks
server/media: don't allow downloading encrypted media without flag
This commit is contained in:
parent
68356a9ef1
commit
508f2252da
1 changed files with 3 additions and 0 deletions
|
@ -204,6 +204,9 @@ func (gmx *Gomuks) DownloadMedia(w http.ResponseWriter, r *http.Request) {
|
|||
} else if (cacheEntry == nil || cacheEntry.EncFile == nil) && encrypted {
|
||||
mautrix.MNotFound.WithMessage("Media encryption keys not found in cache").Write(w)
|
||||
return
|
||||
} else if cacheEntry != nil && cacheEntry.EncFile != nil && !encrypted {
|
||||
mautrix.MNotFound.WithMessage("Tried to download encrypted media without encrypted flag").Write(w)
|
||||
return
|
||||
}
|
||||
|
||||
if gmx.downloadMediaFromCache(ctx, w, r, cacheEntry, false) {
|
||||
|
|
Loading…
Add table
Reference in a new issue