Compare commits

..

No commits in common. "ef253e214a48178a5e606f353d84b0c43da485d8" and "0a00ee8323c27cda5a92f80907c80acde8ef507b" have entirely different histories.

6
api.go
View File

@ -80,15 +80,16 @@ func (s *HTTPServer) RegisterAPIRoutes(r *mux.Router) {
// Get message, either from URL query or multi part form.
var message string
err := r.ParseMultipartForm(32 << 20) // maxMemory 32MB
if err != nil {
if err == nil {
message = r.Form.Get("message")
}
if message == "" {
message = r.URL.Query().Get("message")
}
// If no message provided, fail.
if message == "" {
log.Println("No message provided")
s.APISendGeneralResp(w, APIERR, "No message provided")
return
}
@ -112,6 +113,7 @@ func (s *HTTPServer) RegisterAPIRoutes(r *mux.Router) {
// If no conversation found, likely will happen if no admin is configured, return error.
if conversation == "" {
log.Println("No conversation found")
s.APISendGeneralResp(w, APIERR, "No conversation found")
return
}