Skip to content

Commit

Permalink
chore(lint): add canonicalheader linter and fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Oct 20, 2024
1 parent 05d566c commit 8b5da2c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ linters:
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- copyloopvar
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/headers/headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func SetAuthSSOKey(request *http.Request, key, secret string) {
}

func SetOauth(request *http.Request, value string) {
request.Header.Set("oauth", value)
request.Header.Set("Oauth", value)
}

func SetXFilter(request *http.Request, value string) {
Expand All @@ -39,5 +39,5 @@ func SetXAuthPassword(request *http.Request, value string) {
}

func SetXAPIKey(request *http.Request, value string) {
request.Header.Set("X-API-Key", value)
request.Header.Set("X-Api-Key", value)
}
2 changes: 1 addition & 1 deletion internal/provider/providers/hetzner/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ func (p *Provider) setHeaders(request *http.Request) {
headers.SetUserAgent(request)
headers.SetContentType(request, "application/json")
headers.SetAccept(request, "application/json")
request.Header.Set("Auth-API-Token", p.token)
request.Header.Set("Auth-Api-Token", p.token)
}
2 changes: 1 addition & 1 deletion internal/provider/providers/ovh/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func extractAPIError(response *http.Response) (err error) {
}
apiError.Message = string(b)
}
queryID := response.Header.Get("X-Ovh-QueryID")
queryID := response.Header.Get("X-Ovh-Queryid")

_ = response.Body.Close()

Expand Down

0 comments on commit 8b5da2c

Please sign in to comment.