mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
shot.jpg.
This commit is contained in:
parent
fdd98377b3
commit
1ffbe337d4
@ -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)
|
||||
|
@ -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())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user