Skip to content
Playground(another site)

bynk.http.cors_invalid_field

Error A cors policy field (headers/credentials/maxAge) has the wrong value shape.

Each optional cors field takes one kind of value: headers a list of string literals, credentials the literal true or false, and maxAge a Duration literal such as 1.hour. They are written straight into the Access-Control-* headers the router sends, so they are fixed at compile time: a string, a number or a computed value is refused. origins, the required field, is checked by bynk.http.cors_invalid_origins.

Example

cors { origins: ["https://app.example.com"], credentials: "yes" } // ✗ `true` or `false`
cors { origins: ["https://app.example.com"], credentials: true } // ✓

In the Book

See also

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