Skip to content
Playground(another site)

bynk.http.multipart_body_unbounded

Error A @multipart route has no request-body cap (@limit or limits { maxBody }).

A @multipart body is buffered whole, with its parsed parts held beside it, so an upload with no ceiling lets one client use up the Worker's memory. A @multipart route therefore needs a cap, as a @raw one does (bynk.http.raw_body_unbounded): @limit(maxBody: …) on the handler, or limits { maxBody: … } on the service. Choose the largest upload you mean to accept.

Example

type Upload = { title: String }
@multipart // ✗ no cap on the handler or the service
on POST("/upload") (body: Upload) -> Effect[HttpResult[String]] by v: Visitor { … }
@multipart
@limit(maxBody: 1_000_000) // ✓ capped
on POST("/upload") (body: Upload) -> 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.multipart_body_unbounded shows the same from the installed toolchain, without a network.