mirror of
https://github.com/portainer/portainer.git
synced 2025-07-28 01:39:39 +02:00
refactor(oauth): return parse content error
This commit is contained in:
parent
46e8f10aea
commit
de5f6086d0
1 changed files with 5 additions and 1 deletions
|
@ -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" {
|
if content == "application/x-www-form-urlencoded" || content == "text/plain" {
|
||||||
values, err := url.ParseQuery(string(body))
|
values, err := url.ParseQuery(string(body))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue