THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class documentation
Validate cross-origin requests and attach the required CORS headers.
| Method | __apply |
Write the Access-Control-Allow-Credentials header if needed. |
| Method | __apply |
Write the Access-Control-Allow-Origin (and Vary) headers. |
| Method | __init__ |
Initialize the middleware with the given CORS configuration. |
| Method | __is |
Validate whether an origin is allowed. |
| Method | __is |
Determine whether the request is a CORS preflight. |
| Method | __merge |
Append a directive to the Vary header without overwriting it. |
| Method | after |
Apply CORS headers to actual (non-preflight) responses. |
| Method | before |
Intercept preflight requests and return an early response. |
| Constant | ALL |
Methods allowed in CORS preflight responses when the wildcard is used. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | __allow |
Headers. |
| Instance Variable | __allow |
Methods. |
| Instance Variable | __allow |
Origins. |
| Instance Variable | __allow |
Credentials / Cache. |
| Instance Variable | __allow |
Serialized value of the Access-Control-Allow-Headers header. |
| Instance Variable | __allow |
Serialized value of the Access-Control-Allow-Methods header. |
| Instance Variable | __allow |
Origins permitted by the cross-origin request policy. |
| Instance Variable | __expose |
Serialized value of the Access-Control-Expose-Headers header. |
| Instance Variable | __max |
Pre-render the max-age header value; None disables the header. |
| Instance Variable | __origin |
Compiled regular expression matching permitted request origins. |
Write the Access-Control-Allow-Credentials header if needed.
| Parameters | |
response:orionis.http.Response | The response object to modify. |
| Returns | |
None | Write the Access-Control-Allow-Credentials header if needed. |
Write the Access-Control-Allow-Origin (and Vary) headers.
| Parameters | |
response:orionis.http.Response | The response object to modify. |
origin:str | The Origin header value from the request. |
| Returns | |
None | Write the Access-Control-Allow-Origin (and Vary) headers. |
Append a directive to the Vary header without overwriting it.
| Parameters | |
response:orionis.http.Response | The response object to modify. |
value:str | The directive to add (e.g. "origin"). |
| Returns | |
None | Append a directive to the Vary header without overwriting it. |
Apply CORS headers to actual (non-preflight) responses.
| Parameters | |
adapter:orionis.http.adapters.request.contracts.transport.TransportAdapter | Unified transport abstraction for the current request. |
response:orionis.http.Response | The response produced by the application. |
| Returns | |
orionis.http.Response | The same response object, enriched with CORS headers. |
Intercept preflight requests and return an early response.
| Parameters | |
adapter:orionis.http.adapters.request.contracts.transport.TransportAdapter | Unified transport abstraction for the current request. |
| Returns | |
orionis.http.Response | None | A 204 No Content preflight response, or None when the request is not a valid CORS preflight. |
Methods allowed in CORS preflight responses when the wildcard is used.
| Value |
|