Skip to content

Commit d9f74a5

Browse files
committed
cleanup
1 parent 12ced35 commit d9f74a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

token.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ func (t *Token) SetAuthHeader(r *http.Request) {
102102
if strings.TrimSpace(t.CustomTokenHeaderKey) != "" {
103103
headerKey = t.CustomTokenHeaderKey
104104
}
105-
headerValue := strings.TrimSpace(strings.Join([]string{t.Type(), t.AccessToken}, " "))
105+
headerValue := t.Type() + " " + t.AccessToken
106106
if t.CustomTokenPrefix != "" {
107-
headerValue = strings.TrimSpace(strings.Join([]string{t.CustomTokenPrefix, headerValue}, ""))
107+
headerValue = t.CustomTokenPrefix + headerValue
108108
}
109-
r.Header.Set(headerKey, headerValue)
109+
r.Header.Set(headerKey, strings.TrimSpace(headerValue))
110110
}
111111

112112
// WithExtra returns a new Token that's a clone of t, but using the

0 commit comments

Comments
 (0)