mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Add cache headers to picture integration (#39402)
This commit is contained in:
parent
b71cbd2033
commit
4688171ce0
@ -11,6 +11,7 @@ from aiohttp import hdrs, web
|
||||
from aiohttp.web_request import FileField
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.http.static import CACHE_HEADERS
|
||||
from homeassistant.components.http.view import HomeAssistantView
|
||||
from homeassistant.const import CONF_ID
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
@ -197,7 +198,8 @@ class ImageServeView(HomeAssistantView):
|
||||
)
|
||||
|
||||
return web.FileResponse(
|
||||
target_file, headers={hdrs.CONTENT_TYPE: image_info["content_type"]}
|
||||
target_file,
|
||||
headers={**CACHE_HEADERS, hdrs.CONTENT_TYPE: image_info["content_type"]},
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user