|
A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
|
Cross-origin policy for an A11 HTTP surface. More...
#include <cpp/a11/net/server_headers.h>
Public Member Functions | |
| absl::Status | Validate () const |
Public Attributes | |
| bool | enabled = true |
| Whether cross-origin headers are sent at all. | |
| std::string | allow_origin = "*" |
Access-Control-Allow-Origin. * admits any page. | |
| std::string | allow_methods = "GET, POST, OPTIONS" |
Access-Control-Allow-Methods. Every method A11's routes use. | |
| std::string | allow_headers = "content-type, accept, authorization, x-a11-*" |
Access-Control-Allow-Headers. | |
| std::string | expose_headers = "x-a11-stream-id, x-a11-outbound" |
Access-Control-Expose-Headers: what a page may read off the response. | |
| int | max_age_seconds = 600 |
Access-Control-Max-Age in seconds; 0 omits it. | |
Cross-origin policy for an A11 HTTP surface.
The default admits any browser origin. Set allow_origin to narrow it or clear enabled to omit CORS headers. CORS governs browser access; server reachability is controlled by the listener configuration.
| absl::Status a11::net::CorsOptions::Validate | ( | ) | const |
| std::string a11::net::CorsOptions::allow_headers = "content-type, accept, authorization, x-a11-*" |
Access-Control-Allow-Headers.
A11's own header prefix plus the ones a JSON or SSE request carries.
| std::string a11::net::CorsOptions::allow_methods = "GET, POST, OPTIONS" |
Access-Control-Allow-Methods. Every method A11's routes use.
| std::string a11::net::CorsOptions::allow_origin = "*" |
Access-Control-Allow-Origin. * admits any page.
| bool a11::net::CorsOptions::enabled = true |
Whether cross-origin headers are sent at all.
| std::string a11::net::CorsOptions::expose_headers = "x-a11-stream-id, x-a11-outbound" |
Access-Control-Expose-Headers: what a page may read off the response.
Exposes the stream ID and outbound modes required by browser SSE clients.
| int a11::net::CorsOptions::max_age_seconds = 600 |
Access-Control-Max-Age in seconds; 0 omits it.