Compare commits
No commits in common. "0a00ee8323c27cda5a92f80907c80acde8ef507b" and "ef253e214a48178a5e606f353d84b0c43da485d8" have entirely different histories.
0a00ee8323
...
ef253e214a
6
api.go
6
api.go
@ -80,16 +80,15 @@ func (s *HTTPServer) RegisterAPIRoutes(r *mux.Router) {
|
|||||||
// Get message, either from URL query or multi part form.
|
// Get message, either from URL query or multi part form.
|
||||||
var message string
|
var message string
|
||||||
err := r.ParseMultipartForm(32 << 20) // maxMemory 32MB
|
err := r.ParseMultipartForm(32 << 20) // maxMemory 32MB
|
||||||
if err == nil {
|
if err != nil {
|
||||||
message = r.Form.Get("message")
|
message = r.Form.Get("message")
|
||||||
}
|
}
|
||||||
if message == "" {
|
if message == "" {
|
||||||
message = r.URL.Query().Get("message")
|
message = r.URL.Query().Get("message")
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no message provided, fail.
|
// If no message provided, fail.
|
||||||
if message == "" {
|
if message == "" {
|
||||||
log.Println("No message provided")
|
|
||||||
s.APISendGeneralResp(w, APIERR, "No message provided")
|
s.APISendGeneralResp(w, APIERR, "No message provided")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -113,7 +112,6 @@ func (s *HTTPServer) RegisterAPIRoutes(r *mux.Router) {
|
|||||||
|
|
||||||
// If no conversation found, likely will happen if no admin is configured, return error.
|
// If no conversation found, likely will happen if no admin is configured, return error.
|
||||||
if conversation == "" {
|
if conversation == "" {
|
||||||
log.Println("No conversation found")
|
|
||||||
s.APISendGeneralResp(w, APIERR, "No conversation found")
|
s.APISendGeneralResp(w, APIERR, "No conversation found")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user