mirror of
https://github.com/m1k1o/neko.git
synced 2025-08-06 10:20:26 +02:00
upload drop change API.
This commit is contained in:
parent
3f9fffe96d
commit
d3340ad085
2 changed files with 3 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue