mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
change error messages punctuation.
This commit is contained in:
@ -28,13 +28,13 @@ func (h *RoomHandler) boradcastStart(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if data.URL == "" {
|
||||
utils.HttpBadRequest(w, "Missing broadcast URL.")
|
||||
utils.HttpBadRequest(w, "missing broadcast URL")
|
||||
return
|
||||
}
|
||||
|
||||
broadcast := h.capture.Broadcast()
|
||||
if broadcast.Started() {
|
||||
utils.HttpUnprocessableEntity(w, "Server is already broadcasting.")
|
||||
utils.HttpUnprocessableEntity(w, "server is already broadcasting")
|
||||
return
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ func (h *RoomHandler) boradcastStart(w http.ResponseWriter, r *http.Request) {
|
||||
func (h *RoomHandler) boradcastStop(w http.ResponseWriter, r *http.Request) {
|
||||
broadcast := h.capture.Broadcast()
|
||||
if !broadcast.Started() {
|
||||
utils.HttpUnprocessableEntity(w, "Server is not broadcasting.")
|
||||
utils.HttpUnprocessableEntity(w, "server is not broadcasting")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ func (h *RoomHandler) clipboardGetImage(w http.ResponseWriter, r *http.Request)
|
||||
func (h *RoomHandler) clipboardSetImage(w http.ResponseWriter, r *http.Request) {
|
||||
err := r.ParseMultipartForm(MAX_UPLOAD_SIZE)
|
||||
if err != nil {
|
||||
utils.HttpBadRequest(w, "Failed to parse multipart form.")
|
||||
utils.HttpBadRequest(w, "failed to parse multipart form")
|
||||
return
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ func (h *RoomHandler) clipboardSetImage(w http.ResponseWriter, r *http.Request)
|
||||
|
||||
file, header, err := r.FormFile("file")
|
||||
if err != nil {
|
||||
utils.HttpBadRequest(w, "No file received.")
|
||||
utils.HttpBadRequest(w, "no file received")
|
||||
return
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ func (h *RoomHandler) clipboardSetImage(w http.ResponseWriter, r *http.Request)
|
||||
|
||||
mime := header.Header.Get("Content-Type")
|
||||
if !strings.HasPrefix(mime, "image/") {
|
||||
utils.HttpBadRequest(w, "File must be image.")
|
||||
utils.HttpBadRequest(w, "file must be image")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ func (h *RoomHandler) controlStatus(w http.ResponseWriter, r *http.Request) {
|
||||
func (h *RoomHandler) controlRequest(w http.ResponseWriter, r *http.Request) {
|
||||
host := h.sessions.GetHost()
|
||||
if host != nil {
|
||||
utils.HttpUnprocessableEntity(w, "There is already a host.")
|
||||
utils.HttpUnprocessableEntity(w, "there is already a host")
|
||||
return
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ func (h *RoomHandler) controlRequest(w http.ResponseWriter, r *http.Request) {
|
||||
func (h *RoomHandler) controlRelease(w http.ResponseWriter, r *http.Request) {
|
||||
session := auth.GetSession(r)
|
||||
if !session.IsHost() {
|
||||
utils.HttpUnprocessableEntity(w, "Session is not the host.")
|
||||
utils.HttpUnprocessableEntity(w, "session is not the host")
|
||||
return
|
||||
}
|
||||
|
||||
@ -71,12 +71,12 @@ func (h *RoomHandler) controlGive(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
target, ok := h.sessions.Get(sessionId)
|
||||
if !ok {
|
||||
utils.HttpNotFound(w, "Target session was not found.")
|
||||
utils.HttpNotFound(w, "target session was not found")
|
||||
return
|
||||
}
|
||||
|
||||
if !target.Profile().CanHost {
|
||||
utils.HttpBadRequest(w, "Target session is not allowed to host.")
|
||||
utils.HttpBadRequest(w, "target session is not allowed to host")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ func (h *RoomHandler) uploadMiddleware(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
session := auth.GetSession(r)
|
||||
if !session.IsHost() && (!session.Profile().CanHost || !h.sessions.ImplicitHosting()) {
|
||||
utils.HttpForbidden(w, "Without implicit hosting, only host can upload files.")
|
||||
utils.HttpForbidden(w, "without implicit hosting, only host can upload files")
|
||||
} else {
|
||||
next.ServeHTTP(w, r)
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ func (h *RoomHandler) keyboardMapSet(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
utils.HttpInternalServerError(w, "Unable to change keyboard map.")
|
||||
utils.HttpInternalServerError(w, "unable to change keyboard map")
|
||||
return
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ func (h *RoomHandler) keyboardMapGet(w http.ResponseWriter, r *http.Request) {
|
||||
data, err := h.desktop.GetKeyboardMap()
|
||||
|
||||
if err != nil {
|
||||
utils.HttpInternalServerError(w, "Unable to get keyboard map.")
|
||||
utils.HttpInternalServerError(w, "unable to get keyboard map")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ func (h *RoomHandler) screenConfiguration(w http.ResponseWriter, r *http.Request
|
||||
size := h.desktop.GetScreenSize()
|
||||
|
||||
if size == nil {
|
||||
utils.HttpInternalServerError(w, "Unable to get screen configuration.")
|
||||
utils.HttpInternalServerError(w, "unable to get screen configuration")
|
||||
return
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ func (h *RoomHandler) screenShotGet(w http.ResponseWriter, r *http.Request) {
|
||||
func (h *RoomHandler) screenCastGet(w http.ResponseWriter, r *http.Request) {
|
||||
screencast := h.capture.Screencast()
|
||||
if !screencast.Enabled() {
|
||||
utils.HttpBadRequest(w, "Screencast pipeline is not enabled.")
|
||||
utils.HttpBadRequest(w, "screencast pipeline is not enabled")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ const (
|
||||
func (h *RoomHandler) uploadDrop(w http.ResponseWriter, r *http.Request) {
|
||||
err := r.ParseMultipartForm(MAX_UPLOAD_SIZE)
|
||||
if err != nil {
|
||||
utils.HttpBadRequest(w, "Failed to parse multipart form.")
|
||||
utils.HttpBadRequest(w, "failed to parse multipart form")
|
||||
return
|
||||
}
|
||||
|
||||
@ -28,19 +28,19 @@ func (h *RoomHandler) uploadDrop(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
X, err := strconv.Atoi(r.FormValue("x"))
|
||||
if err != nil {
|
||||
utils.HttpBadRequest(w, "No X coordinate received.")
|
||||
utils.HttpBadRequest(w, "no X coordinate received")
|
||||
return
|
||||
}
|
||||
|
||||
Y, err := strconv.Atoi(r.FormValue("y"))
|
||||
if err != nil {
|
||||
utils.HttpBadRequest(w, "No Y coordinate received.")
|
||||
utils.HttpBadRequest(w, "no Y coordinate received")
|
||||
return
|
||||
}
|
||||
|
||||
req_files := r.MultipartForm.File["files"]
|
||||
if len(req_files) == 0 {
|
||||
utils.HttpBadRequest(w, "No files received.")
|
||||
utils.HttpBadRequest(w, "no files received")
|
||||
return
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ func (h *RoomHandler) uploadDrop(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if !h.desktop.DropFiles(X, Y, files) {
|
||||
utils.HttpInternalServerError(w, "Unable to drop files.")
|
||||
utils.HttpInternalServerError(w, "unable to drop files")
|
||||
return
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ func (h *RoomHandler) uploadDrop(w http.ResponseWriter, r *http.Request) {
|
||||
func (h *RoomHandler) uploadDialogPost(w http.ResponseWriter, r *http.Request) {
|
||||
err := r.ParseMultipartForm(MAX_UPLOAD_SIZE)
|
||||
if err != nil {
|
||||
utils.HttpBadRequest(w, "Failed to parse multipart form.")
|
||||
utils.HttpBadRequest(w, "failed to parse multipart form")
|
||||
return
|
||||
}
|
||||
|
||||
@ -98,13 +98,13 @@ func (h *RoomHandler) uploadDialogPost(w http.ResponseWriter, r *http.Request) {
|
||||
defer r.MultipartForm.RemoveAll()
|
||||
|
||||
if !h.desktop.IsFileChooserDialogOpened() {
|
||||
utils.HttpBadRequest(w, "Open file chooser dialog first.")
|
||||
utils.HttpBadRequest(w, "open file chooser dialog first")
|
||||
return
|
||||
}
|
||||
|
||||
req_files := r.MultipartForm.File["files"]
|
||||
if len(req_files) == 0 {
|
||||
utils.HttpBadRequest(w, "No files received.")
|
||||
utils.HttpBadRequest(w, "no files received")
|
||||
return
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ func (h *RoomHandler) uploadDialogPost(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if err := h.desktop.HandleFileChooserDialog(dir); err != nil {
|
||||
utils.HttpInternalServerError(w, "Unable to handle file chooser dialog.")
|
||||
utils.HttpInternalServerError(w, "unable to handle file chooser dialog")
|
||||
return
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ func (h *RoomHandler) uploadDialogPost(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func (h *RoomHandler) uploadDialogClose(w http.ResponseWriter, r *http.Request) {
|
||||
if !h.desktop.IsFileChooserDialogOpened() {
|
||||
utils.HttpBadRequest(w, "File chooser dialog is not open.")
|
||||
utils.HttpBadRequest(w, "file chooser dialog is not open")
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user