UrlEncodedBodyBuffer

works.iterative.server.http.impl.pac4j.UrlEncodedBodyBuffer

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply[F[_] : Sync](maxSizeBytes: Long): (HttpRoutes[F]) => HttpRoutes[F]

Wraps HttpRoutes[F] so that every application/x-www-form-urlencoded request is read into a strict Chunk[Byte] and rebuilt with a re-runnable body before it reaches the wrapped routes. Every other content type passes through untouched.

Wraps HttpRoutes[F] so that every application/x-www-form-urlencoded request is read into a strict Chunk[Byte] and rebuilt with a re-runnable body before it reaches the wrapped routes. Every other content type passes through untouched.

A body whose measured size exceeds maxSizeBytes is rejected with a bare 413 Payload Too Large, before it reaches the wrapped routes. Content-Length above maxSizeBytes short-circuits without reading the body at all; otherwise the measured length, capped at maxSizeBytes + 1, always governs.

The rebuilt request carries framing headers matching its buffered body: Content-Length is set to the measured chunk size and the chunked transfer-coding is dropped, whatever framing the client used. A transfer-coding that describes the bytes themselves, such as gzip, is preserved, so the headers keep describing what the body actually contains.

Value parameters

maxSizeBytes

must be strictly between 0 and Int.MaxValue. A limit outside that range cannot be enforced correctly -- maxSizeBytes + 1 would overflow -- so it is rejected here, at construction, rather than silently letting an unbounded body through.

Attributes