Skip to content
Playground(another site)

bynk.http.security_not_http

Error A security { } policy appears on a service that is not from http.

A security { } section sets the security headers, Strict-Transport-Security and X-Content-Type-Options, stamped on a service's HTTP responses. Only a from http service sends them, so on a cron or other service the section is refused. Move it to the HTTP service it was meant for, or delete it. The cors, limits and json sections have the same rule: bynk.http.cors_not_http, bynk.http.limits_not_http, bynk.http.json_not_http.

Example

service jobs from cron {
security { hsts: 180.days } // ✗ a schedule sends no response headers
on schedule("0 0 * * *") () -> Effect[Result[(), String]] { … }
}
service api from http {
security { hsts: 180.days } // ✓
on GET("/items") () -> 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.security_not_http shows the same from the installed toolchain, without a network.