likyh commented on code in PR #4435:
URL:
https://github.com/apache/incubator-devlake/pull/4435#discussion_r1109280252
##########
backend/plugins/bamboo/models/connection.go:
##########
@@ -40,51 +40,45 @@ type BambooConn struct {
api.AccessToken `mapstructure:",squash"`
}
-// this function is used to rewrite the same function of AccessToken
-func (conn *BambooConn) SetupAuthentication(request *http.Request)
errors.Error {
- request.Header.Set("Authorization", fmt.Sprintf("Bearer %v",
conn.Token))
- return nil
-}
-
// PrepareApiClient test api and set the IsPrivateToken,version,UserId and so
on.
func (conn *BambooConn) PrepareApiClient(apiClient
apihelperabstract.ApiClientAbstract) errors.Error {
header := http.Header{}
header.Set("Authorization", fmt.Sprintf("Bearer %v", conn.Token))
res, err := apiClient.Get("", nil, header)
if err != nil {
- return errors.HttpStatus(500).New(fmt.Sprintf("Get failed %s",
err.Error()))
+ return errors.HttpStatus(400).New(fmt.Sprintf("Get failed %s",
err.Error()))
Review Comment:
errors.BadInput.New ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]