Skip to content
Playground(another site)

bynk.http.raw_body_unbounded

Error A @raw route has no request-body cap (no @limit and no service limits).

A @raw route hands the handler its request body as untouched octets, buffered in memory up to a cap. With no cap there is no bound on that buffer, which is the denial of service request body limits exist to stop, so a raw route must have one: a @limit(maxBody:) on the handler, or a limits { maxBody = … } on the service.

Example

@raw(contentType: "image/png") // ✗ no cap anywhere
on POST("/avatars") (body: Bytes) -> Effect[HttpResult[String]] by v: Visitor { … }
@raw(contentType: "image/png") // ✓ capped
@limit(maxBody: 5_000_000)
on POST("/avatars") (body: Bytes) -> Effect[HttpResult[String]] by v: Visitor { … }

In the Book

See also

  • Every code in its category, HTTP, on the diagnostic index.
  • bynk explain bynk.http.raw_body_unbounded shows the same from the installed toolchain, without a network.