diff --git a/internal/api/room/handler.go b/internal/api/room/handler.go index 374df970..c76937a7 100644 --- a/internal/api/room/handler.go +++ b/internal/api/room/handler.go @@ -61,7 +61,7 @@ func (h *RoomHandler) Route(r chi.Router) { r.With(auth.AdminsOnly).Get("/configurations", h.screenConfigurationsList) }) - r.Route("/drop", func(r chi.Router) { - r.With(auth.AdminsOnly).Post("/", h.dropFiles) + r.With(auth.HostsOnly).Route("/upload", func(r chi.Router) { + r.Post("/drop", h.uploadDrop) }) } diff --git a/internal/api/room/drop.go b/internal/api/room/upload.go similarity index 94% rename from internal/api/room/drop.go rename to internal/api/room/upload.go index 145c53b2..03f2c3aa 100644 --- a/internal/api/room/drop.go +++ b/internal/api/room/upload.go @@ -16,7 +16,7 @@ const ( MAX_UPLOAD_SIZE = 32 << 20 ) -func (h *RoomHandler) dropFiles(w http.ResponseWriter, r *http.Request) { +func (h *RoomHandler) uploadDrop(w http.ResponseWriter, r *http.Request) { r.ParseMultipartForm(MAX_UPLOAD_SIZE) X, err := strconv.Atoi(r.FormValue("x"))