Mixin
Shared request-handler mixin for odin-control.
This module implements a mixin class providing CORS and Server header behaviour used by both API and static route handlers.
Tim Nicholls, STFC Detector Systems Software Group
HandlerMixin
Mixin to apply CORS and Server header behaviour to handlers.
Source code in src/odin_control/http/handlers/mixin.py
initialize(*args, **kwargs)
Initialise handler and set CORS headers if enabled.
Expects optional enable_cors and cors_origin keyword arguments in
handler URLSpec params.
Source code in src/odin_control/http/handlers/mixin.py
options(*_)
set_default_headers()
Set default response headers including an OdinControl Server token.
This method overrides the base RequestHandler to set the default Server header for all responses. The header is set to include name and version of odin-control. If the header is already set, e.g. by the base Tornado implementation, append that value to the header.