mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
file chooser dialog diabled by default.
This commit is contained in:
@ -87,6 +87,10 @@ func (h *RoomHandler) uploadDrop(w http.ResponseWriter, r *http.Request) error {
|
||||
}
|
||||
|
||||
func (h *RoomHandler) uploadDialogPost(w http.ResponseWriter, r *http.Request) error {
|
||||
if !h.desktop.IsFileChooserDialogEnabled() {
|
||||
return utils.HttpBadRequest("file chooser dialog is disabled")
|
||||
}
|
||||
|
||||
err := r.ParseMultipartForm(maxUploadSize)
|
||||
if err != nil {
|
||||
return utils.HttpBadRequest("failed to parse multipart form").WithInternalErr(err)
|
||||
@ -150,6 +154,10 @@ func (h *RoomHandler) uploadDialogPost(w http.ResponseWriter, r *http.Request) e
|
||||
}
|
||||
|
||||
func (h *RoomHandler) uploadDialogClose(w http.ResponseWriter, r *http.Request) error {
|
||||
if !h.desktop.IsFileChooserDialogEnabled() {
|
||||
return utils.HttpBadRequest("file chooser dialog is disabled")
|
||||
}
|
||||
|
||||
if !h.desktop.IsFileChooserDialogOpened() {
|
||||
return utils.HttpUnprocessableEntity("file chooser dialog is not open")
|
||||
}
|
||||
|
Reference in New Issue
Block a user