From 8f2febebbf98f82a2c18cce9e7c57fa60efc7be8 Mon Sep 17 00:00:00 2001 From: Caj Larsson Date: Fri, 22 Apr 2022 22:18:14 +0800 Subject: [PATCH] Use Content-length to deny files larger than quota --- domain/services.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/domain/services.go b/domain/services.go index e2df49f..9fa3222 100644 --- a/domain/services.go +++ b/domain/services.go @@ -46,6 +46,8 @@ func (b BogFileService) SaveFile(ref FileReference, src io.Reader, size int64) e io.Copy(f, src) f.Close() + user_agent.FileQuota.Add(size) + b.user_agent_repo.Update(user_agent.ID, *user_agent) return nil }