What it checks
The body as received, against two ceilings, in this order:
Bytes are checked first. A body that passes the byte ceiling is then counted in
characters, so a request can be small in bytes and still refused for length, and
a multi-byte script can hit the byte ceiling before the character one.
What the client gets
A refused request is answered before any provider is contacted:
Requiring
Content-Length refuses chunked uploads and clients that stream a
body of unknown size. That is the point — a declared size can be judged before
the body is read — but it also refuses well-behaved clients that stream, so turn
it on only where every caller is yours.
In Observe mode the request is measured, recorded on the event as over the
limit, and passed through.