if i'm reading this correctly, i don't think the auth header will actually be
set with the override value.. here's a shot at a proposed remedy.. i did
not test it out :-)
```
func (c *Client) addAuthHeader(req *http.Request, authRequired bool) error {
// Allow for authorization override via Additional Headers
authHeaderValue := c.Config.AdditionalHeaders.Get("Authorization")
if authHeaderValue != "" {
Debug(DbgInfo, "Using additional header authorization\n")
} else if c.Config.AuthToken != "" {
authHeaderValue = c.Config.AuthToken
Debug(DbgInfo, "Adding basic auth header; using authkey\n")
} else {
if authRequired {
Debug(DbgError, "The required authorization key is not
configured - neither set as a property nor set via the --auth CLI argument\n")
errStr := wski18n.T("Authorization key is not
configured (--auth is required)")
werr := MakeWskError(errors.New(errStr),
EXIT_CODE_ERR_USAGE, DISPLAY_MSG, DISPLAY_USAGE)
return werr
}
}
req.Header.Add("Authorization", fmt.Sprintf("Basic %s",
base64.StdEncoding.EncodeToString([]byte(authHeaderValue))))
return nil
}
```
[ Full content available at:
https://github.com/apache/incubator-openwhisk-client-go/pull/100 ]
This message was relayed via gitbox.apache.org for [email protected]