Second async test for Broker's proxy answer handler

This commit is contained in:
Serene Han 2016-02-15 11:31:57 -08:00
parent 032ab6bcb8
commit ee5f4558af
2 changed files with 42 additions and 3 deletions

View file

@ -210,7 +210,7 @@ func answerHandler(ctx *BrokerContext, w http.ResponseWriter, r *http.Request) {
return
}
body, err := ioutil.ReadAll(r.Body)
if nil != err {
if nil != err || nil == body || len(body) <= 0 {
log.Println("Invalid data.")
w.WriteHeader(http.StatusBadRequest)
return