upload drop change API.

This commit is contained in:
Miroslav Šedivý 2021-01-07 18:28:23 +01:00
parent 3f9fffe96d
commit d3340ad085
2 changed files with 3 additions and 3 deletions

View File

@ -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)
})
}

View File

@ -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"))