mirror of
https://github.com/minio/minio.git
synced 2025-02-04 10:26:01 -05:00
Show 401 unauthorized msg when nodes are started with different creds (#7433)
Before this commit, nodes wait indefinitely without showing any indicate error message when a node is started with different access and secret keys. This PR will show '401 Unauthorized' in this case.
This commit is contained in:
parent
93a9078b23
commit
53011606a5
@ -66,8 +66,11 @@ func (c *Client) Call(method string, values url.Values, body io.Reader, length i
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if len(b) > 0 {
|
||||||
return nil, errors.New(string(b))
|
return nil, errors.New(string(b))
|
||||||
}
|
}
|
||||||
|
return nil, errors.New(resp.Status)
|
||||||
|
}
|
||||||
return resp.Body, nil
|
return resp.Body, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,6 +353,14 @@ func (client *storageRESTClient) RenameFile(srcVolume, srcPath, dstVolume, dstPa
|
|||||||
|
|
||||||
// Gets peer storage server's instanceID - to be used with every REST call for validation.
|
// Gets peer storage server's instanceID - to be used with every REST call for validation.
|
||||||
func (client *storageRESTClient) getInstanceID() (err error) {
|
func (client *storageRESTClient) getInstanceID() (err error) {
|
||||||
|
// getInstanceID() does not use storageRESTClient.call()
|
||||||
|
// function so we need to update lastError field here.
|
||||||
|
defer func() {
|
||||||
|
if err != nil {
|
||||||
|
client.lastError = err
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
respBody, err := client.restClient.Call(storageRESTMethodGetInstanceID, nil, nil, -1)
|
respBody, err := client.restClient.Call(storageRESTMethodGetInstanceID, nil, nil, -1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user