fix: api descript

This commit is contained in:
wwweww
2026-02-28 05:33:16 +08:00
parent 5930fb0dde
commit d2f33b4b96
243 changed files with 37065 additions and 780 deletions
@@ -5,6 +5,8 @@ package middleware
import "net/http"
const maxUploadSizeBytes int64 = 20 << 20
type FileSizeLimitMiddleware struct {
}
@@ -14,9 +16,10 @@ func NewFileSizeLimitMiddleware() *FileSizeLimitMiddleware {
func (m *FileSizeLimitMiddleware) Handle(next http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// TODO generate middleware implement function, delete after code implementation
if r.Method == http.MethodPost && r.URL != nil && r.URL.Path == "/api/v1/upload" {
r.Body = http.MaxBytesReader(w, r.Body, maxUploadSizeBytes)
}
// Passthrough to next handler if need
next(w, r)
}
}