Enable cache headers on styling (#270)
This commit is contained in:
committed by
GitHub
parent
16c45544d3
commit
084e0e606e
@@ -6,6 +6,7 @@ from typing import OrderedDict
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.components.http import StaticPathConfig
|
||||
|
||||
# Import and re-export config schema explictly
|
||||
# pylint: disable=useless-import-alias
|
||||
@@ -146,6 +147,16 @@ async def _setup_oidc_provider(hass: HomeAssistant, my_config: dict, display_nam
|
||||
|
||||
force_https = features_config.get(FEATURES_FORCE_HTTPS, False)
|
||||
|
||||
await hass.http.async_register_static_paths(
|
||||
[
|
||||
StaticPathConfig(
|
||||
"/auth/oidc/static/style.css",
|
||||
hass.config.path("custom_components/auth_oidc/static/style.css"),
|
||||
cache_headers=True,
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
hass.http.register_view(
|
||||
OIDCWelcomeView(provider, name, force_https, has_other_auth_providers)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user