Implement external assets

This commit is contained in:
Malte Jürgens 2023-09-15 18:20:16 +02:00
parent 2e234300a2
commit a61e7c7a39
No known key found for this signature in database
22 changed files with 826 additions and 119 deletions

View file

@ -122,6 +122,11 @@ func ServeAttachment(ctx *context.Context, uuid string) {
}
}
if attach.ExternalURL != "" {
ctx.Redirect(attach.ExternalURL)
return
}
if err := attach.IncreaseDownloadCount(ctx); err != nil {
ctx.ServerError("IncreaseDownloadCount", err)
return