MCPcopy Index your code
hub / github.com/labstack/echo / BodyLimit

Function BodyLimit

middleware/body_limit.go:34–36  ·  view source on GitHub ↗

BodyLimit returns a BodyLimit middleware. BodyLimit middleware sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends "413 - Request Entity Too Large" response. The BodyLimit is determined based on both `Content-Length` request header and actual content

(limitBytes int64)

Source from the content-addressed store, hash-verified

32// sends "413 - Request Entity Too Large" response. The BodyLimit is determined based on both `Content-Length` request
33// header and actual content read, which makes it super secure.
34func BodyLimit(limitBytes int64) echo.MiddlewareFunc {
35 return BodyLimitWithConfig(BodyLimitConfig{LimitBytes: limitBytes})
36}
37
38// BodyLimitWithConfig returns a BodyLimitWithConfig middleware. Middleware sets the maximum allowed size in bytes for
39// a request body, if the size exceeds the configured limit, it sends "413 - Request Entity Too Large" response.

Callers 2

TestBodyLimitFunction · 0.85

Calls 1

BodyLimitWithConfigFunction · 0.85

Tested by 2

TestBodyLimitFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…