mirror of https://github.com/minio/minio.git
fix: return proper error if OIDC Discoverydoc fails to respond (#17242)
This commit is contained in:
parent
7d433f16c4
commit
e94e6adf91
|
@ -90,7 +90,7 @@ func parseDiscoveryDoc(ustr string) (DiscoveryDoc, error) {
|
|||
}
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return d, err
|
||||
return d, fmt.Errorf("unexpected error returned by %s : status(%s)", ustr, resp.Status)
|
||||
}
|
||||
dec := json.NewDecoder(resp.Body)
|
||||
if err = dec.Decode(&d); err != nil {
|
||||
|
|
|
@ -279,7 +279,7 @@ func parseDiscoveryDoc(u *xnet.URL, transport http.RoundTripper, closeRespFn fun
|
|||
}
|
||||
defer closeRespFn(resp.Body)
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return d, err
|
||||
return d, fmt.Errorf("unexpected error returned by %s : status(%s)", u, resp.Status)
|
||||
}
|
||||
dec := json.NewDecoder(resp.Body)
|
||||
if err = dec.Decode(&d); err != nil {
|
||||
|
|
Loading…
Reference in New Issue