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

Function BodyLimitWithConfig

middleware/body_limit.go:42–44  ·  view source on GitHub ↗

BodyLimitWithConfig returns a BodyLimitWithConfig middleware. Middleware sets the maximum allowed size in bytes for a request body, if the size exceeds the configured limit, it sends "413 - Request Entity Too Large" response. The BodyLimitWithConfig is determined based on both `Content-Length` requ

(config BodyLimitConfig)

Source from the content-addressed store, hash-verified

40// The BodyLimitWithConfig is determined based on both `Content-Length` request header and actual content read, which
41// makes it super secure.
42func BodyLimitWithConfig(config BodyLimitConfig) echo.MiddlewareFunc {
43 return toMiddlewareOrPanic(config)
44}
45
46// ToMiddleware converts BodyLimitConfig to middleware or returns an error for invalid configuration
47func (config BodyLimitConfig) ToMiddleware() (echo.MiddlewareFunc, error) {

Callers 2

BodyLimitFunction · 0.85
TestBodyLimitWithConfigFunction · 0.85

Calls 1

toMiddlewareOrPanicFunction · 0.85

Tested by 1

TestBodyLimitWithConfigFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…