Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions google/externalaccount/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package externalaccount

import (
"bytes"
"context"
"crypto/hmac"
"crypto/sha256"
Expand Down Expand Up @@ -148,13 +147,13 @@ func canonicalHeaders(req *http.Request) (string, string) {
}
sort.Strings(headers)

var fullHeaders bytes.Buffer
var fullHeaders strings.Builder
for _, header := range headers {
headerValue := strings.Join(lowerCaseHeaders[header], ",")
fullHeaders.WriteString(header)
fullHeaders.WriteRune(':')
fullHeaders.WriteByte(':')
fullHeaders.WriteString(headerValue)
fullHeaders.WriteRune('\n')
fullHeaders.WriteByte('\n')
}

return strings.Join(headers, ";"), fullHeaders.String()
Expand Down
3 changes: 1 addition & 2 deletions oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
package oauth2 // import "golang.org/x/oauth2"

import (
"bytes"
"context"
"errors"
"net/http"
Expand Down Expand Up @@ -158,7 +157,7 @@ func SetAuthURLParam(key, value string) AuthCodeOption {
// PKCE), https://www.oauth.com/oauth2-servers/pkce/ and
// https://www.ietf.org/archive/id/draft-ietf-oauth-v2-1-09.html#name-cross-site-request-forgery (describing both approaches)
func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string {
var buf bytes.Buffer
var buf strings.Builder
buf.WriteString(c.Endpoint.AuthURL)
v := url.Values{
"response_type": {"code"},
Expand Down