1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

refactor(oauth): return parse content error

This commit is contained in:
Chaim Lev Ari 2019-01-18 11:51:41 +02:00
parent 46e8f10aea
commit de5f6086d0

View file

@ -56,7 +56,11 @@ func (*Service) GetUsername(token string, settings *portainer.OAuthSettings) (st
}
}
content, _, _ := mime.ParseMediaType(resp.Header.Get("Content-Type"))
content, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
if err != nil {
return "", err
}
if content == "application/x-www-form-urlencoded" || content == "text/plain" {
values, err := url.ParseQuery(string(body))
if err != nil {