Добавьте S3-вложения с дедупликацией и безопасной сверкой хранилищ

This commit is contained in:
2026-11-16 12:36:59 +03:00
parent b323f2dab9
commit d761861def
54 changed files with 5061 additions and 102 deletions
+5
View File
@@ -123,6 +123,11 @@ func Timeout(d time.Duration) gin.HandlerFunc {
// decoder as *http.MaxBytesError.
func bodyLimit(maxBytes int64) gin.HandlerFunc {
return func(c *gin.Context) {
// The authenticated binary handler installs its own 10 MiB limit.
if c.Request.Method == http.MethodPost && c.FullPath() == "/api/v1/chats/:chat_id/attachments" {
c.Next()
return
}
if c.Request.Body != nil {
c.Request.Body = http.MaxBytesReader(c.Writer, c.Request.Body, maxBytes)
}