diff --git a/internal/api/room/handler.go b/internal/api/room/handler.go index 0718cbd6..de9485a0 100644 --- a/internal/api/room/handler.go +++ b/internal/api/room/handler.go @@ -62,7 +62,7 @@ func (h *RoomHandler) Route(r chi.Router) { r.Route("/screen", func(r chi.Router) { r.With(auth.CanWatchOnly).Get("/", h.screenConfiguration) - r.With(auth.CanWatchOnly).Get("/image", h.screenImageGet) + r.With(auth.CanWatchOnly).Get("/shot.jpg", h.screenShotGet) r.With(auth.CanWatchOnly).Get("/cast.jpg", h.screenCastGet) r.With(auth.AdminsOnly).Post("/", h.screenConfigurationChange) diff --git a/internal/api/room/screen.go b/internal/api/room/screen.go index 70645cc9..9003f422 100644 --- a/internal/api/room/screen.go +++ b/internal/api/room/screen.go @@ -76,7 +76,7 @@ func (h *RoomHandler) screenConfigurationsList(w http.ResponseWriter, r *http.Re utils.HttpSuccess(w, list) } -func (h *RoomHandler) screenImageGet(w http.ResponseWriter, r *http.Request) { +func (h *RoomHandler) screenShotGet(w http.ResponseWriter, r *http.Request) { var options *jpeg.Options if quality, err := strconv.Atoi(r.URL.Query().Get("quality")); err == nil { options = &jpeg.Options{ quality } @@ -92,6 +92,7 @@ func (h *RoomHandler) screenImageGet(w http.ResponseWriter, r *http.Request) { return } + w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") w.Header().Set("Content-Type", "image/jpeg") w.Write(out.Bytes()) }