google: Use bytes.Buffer for go 1.9 compatability

Update test cases to use const test data file references.

Change-Id: Ic08b6de5a84db7b2ae2c649ee676c5a2c13f4227
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/306749
Reviewed-by: Cody Oss <codyoss@google.com>
Trust: Cody Oss <codyoss@google.com>
Trust: Tyler Bui-Palsulich <tbp@google.com>
Run-TryBot: Cody Oss <codyoss@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
Joel Ferrier
2021-04-01 16:22:52 -07:00
committed by Cody Oss
parent 22b0adad75
commit 2e8d934016
3 changed files with 11 additions and 5 deletions

View File

@@ -5,6 +5,7 @@
package externalaccount
import (
"bytes"
"context"
"crypto/hmac"
"crypto/sha256"
@@ -127,7 +128,7 @@ func canonicalHeaders(req *http.Request) (string, string) {
}
sort.Strings(headers)
var fullHeaders strings.Builder
var fullHeaders bytes.Buffer
for _, header := range headers {
headerValue := strings.Join(lowerCaseHeaders[header], ",")
fullHeaders.WriteString(header)