feat: add shared size limit constants

This commit is contained in:
2026-05-18 15:08:26 +02:00
parent 56c8618f5f
commit 943285b356
6 changed files with 23 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"io"
"mal/internal/domain"
"mal/pkg/net/limits"
"mal/pkg/net/proxytransport"
"mal/pkg/net/useragent"
"maps"
@@ -321,7 +322,7 @@ func (h *PlaybackHandler) HandleProxySubtitle(c *gin.Context) {
}
defer func() { _ = resp.Body.Close() }()
body, err := io.ReadAll(io.LimitReader(resp.Body, 2*1024*1024))
body, err := io.ReadAll(io.LimitReader(resp.Body, limits.MiB2))
if err != nil {
c.Status(http.StatusBadGateway)
return