mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
upload drop change API.
This commit is contained in:
parent
3f9fffe96d
commit
d3340ad085
@ -61,7 +61,7 @@ func (h *RoomHandler) Route(r chi.Router) {
|
|||||||
r.With(auth.AdminsOnly).Get("/configurations", h.screenConfigurationsList)
|
r.With(auth.AdminsOnly).Get("/configurations", h.screenConfigurationsList)
|
||||||
})
|
})
|
||||||
|
|
||||||
r.Route("/drop", func(r chi.Router) {
|
r.With(auth.HostsOnly).Route("/upload", func(r chi.Router) {
|
||||||
r.With(auth.AdminsOnly).Post("/", h.dropFiles)
|
r.Post("/drop", h.uploadDrop)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ const (
|
|||||||
MAX_UPLOAD_SIZE = 32 << 20
|
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)
|
r.ParseMultipartForm(MAX_UPLOAD_SIZE)
|
||||||
|
|
||||||
X, err := strconv.Atoi(r.FormValue("x"))
|
X, err := strconv.Atoi(r.FormValue("x"))
|
Loading…
Reference in New Issue
Block a user