Skip to content
Playground(another site)

bynk.types.headers_at_boundary

Error RequestHeaders appears where a value is stored or sent: a field of a type, or a boundary such as a call, a message or an agent.

RequestHeaders is the view of one request's headers, given to the handler that is answering it. It is read there and dropped: headers can carry credentials such as Authorization, and a copy kept or sent on would outlive the request. It is accepted only as an HTTP handler's headers parameter, and refused as a record, sum or event field, an agent key or store field, a capability operation, or any other handler parameter or result. Read the header you need (headers.get("…")) and keep that String. See also bynk.types.request_query_at_boundary.

Example

type Seen = {
headers: RequestHeaders, // ✗ a request's headers are not data to keep
}
type Seen = {
userAgent: String, // ✓ keep the value you read
}

In the Book

See also

  • Every code in its category, Type checking, on the diagnostic index.
  • bynk explain bynk.types.headers_at_boundary shows the same from the installed toolchain, without a network.