BodyLimitsMiddleware class final

Request body limits (BLUEPRINT_V2 §2.3). Defaults: 1 MiB for JSON and form bodies, 50 MiB for multipart/other bodies, JSON nesting ≤ 64.

Limits are enforced lazily by Request.bytes / Request.body, after a cheap content-length pre-check, so a request that never reads its body costs nothing. Routes may override the byte limit with RouteEntry.bodyLimit.

Implemented types

Constructors

BodyLimitsMiddleware({int json = 1 << 20, int form = 1 << 20, int other = 50 << 20, int jsonDepth = 64})
const

Properties

form → int
final
hashCode → int
The hash code for this object.
no setterinherited
json → int
final
jsonDepth → int
final
other → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

handle(Request request, Next next) → Future<Response>
override
limitFor(Request request) → int
Byte limit that applies to request based on its content type.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited