Commit 86da932b authored by Liza's avatar Liza

Check for empty body when trying to get user from user res

parent 6963a264
Pipeline #75823816 passed with stages
in 26 minutes and 48 seconds
......@@ -68,7 +68,13 @@ func GetUserFromUserRes(res *http2.Response) (*user.User, error) {
var err error
body, err = ioutil.ReadAll(res.Body)
if err != nil {
error2.HandleErr(err, "Login Error")
error2.HandleErr(err, "GetUserFromUserRes Error")
return nil, err
}
if len(body) == 0 {
err = errors.New("body is empty - has it already been consumed")
error2.HandleErr(err, "GetUserFromUserRes Error")
return nil, err
}
userResp := UserRes{}
......
......@@ -2,7 +2,7 @@
"Providers":
[
{
"Name": "MySql",
"Name": "mysql",
"Properties": {
"table_name": "users",
"session_length": "60"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment