handler
Service worker handler for Datalayer Core.
class ServiceWorkerHandler(application: 'Application', request: tornado.httputil.HTTPServerRequest, **kwargs: Any) -> None
Serve the service worker script.
initialize() -> None
Initialize the API spec handler.
validate_absolute_path(root: str, absolute_path: str) -> Optional[str]
Only allow to serve the service worker.
Parameters
-
root : str
The root directory path.
-
absolute_path : str
The absolute path to validate.
Returns
-
Optional[str]
The validated absolute path or None.
get_content_type() -> str
Get the content type.
Returns
-
str
The content type for JavaScript files.
set_extra_headers(path: str) -> None
Add extra headers to the response.
Parameters
-
path : str
The file path being served.