Explicitly ignore errors from writes to responses
Some checks failed
/ docker (push) Failing after 15m26s
Some checks failed
/ docker (push) Failing after 15m26s
This commit is contained in:
parent
ef95a0552d
commit
4a2462e24e
30 changed files with 280 additions and 237 deletions
|
@ -24,7 +24,7 @@ func SignRequest(r *http.Request, keyId string, privateKeyBytes, postBody []byte
|
|||
} else {
|
||||
headers.Set("Date", time.Now().UTC().Format(http.TimeFormat))
|
||||
}
|
||||
applyBodyHash(headers, postBody)
|
||||
_ = applyBodyHash(headers, postBody)
|
||||
// Filter for only the date, host, digest and request-target headers
|
||||
var signedString string
|
||||
var usedHeaders []string
|
||||
|
|
|
@ -21,7 +21,7 @@ func TestSignRequest(t *testing.T) {
|
|||
func Test_applyBodyHash_WithBody(t *testing.T) {
|
||||
var headers = make(http.Header, 0)
|
||||
digest := "SHA-256=" + string(testBodyHash)
|
||||
applyBodyHash(headers, []byte(testBody))
|
||||
_ = applyBodyHash(headers, []byte(testBody))
|
||||
headerDigest := headers.Get("Digest")
|
||||
if headerDigest != digest {
|
||||
t.Fatalf("digests didn't match: header \"%v\" != precalc \"%v\"", headerDigest, digest)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue