Skip to content

Commit c398f83

Browse files
committed
Fixed: One more test case for a draft issue
1 parent b92832d commit c398f83

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

digest_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ func TestValidateContentDigestHeader(t *testing.T) {
9696
err = ValidateContentDigestHeader(hdr, &res6.Body, []string{DigestSha256})
9797
assert.Error(t, err, "digest mismatch")
9898

99-
// TODO fix when the draft is modified,https://github.com/httpwg/http-extensions/pull/2049
99+
// Response taken from the draft,see https://github.com/httpwg/http-extensions/pull/2049
100100
res7 := readResponse(httpres4)
101101
hdr = res7.Header.Values("Content-Digest")
102102
err = ValidateContentDigestHeader(hdr, &res7.Body, []string{DigestSha512})
103-
assert.Error(t, err, "digest mismatch?")
103+
assert.NoError(t, err, "digest mismatch?")
104104
}

signatures_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ Content-Length: 18
166166
var httpres4 = `HTTP/1.1 200 OK
167167
Date: Tue, 20 Apr 2021 02:07:56 GMT
168168
Content-Type: application/json
169-
Content-Digest: sha-512=:JlEy2bfUz7WrWIjc1qV6KVLpdr/7L5/L4h7Sxvh6sNHpDQWDCL+GauFQWcZBvVDhiyOnAQsxzZFYwi0wDH+1pw==:
169+
Content-Digest: sha-512=:mEWXIS7MaLRuGgxOBdODa3xqM1XdEvxoYhvlCFJ41QJgJc4GTsPp29l5oGX69wWdXymyU0rjJuahq4l5aGgfLQ==:
170170
Content-Length: 23
171171
Signature-Input: sig-b24=("@status" "content-type" "content-digest" "content-length");created=1618884473;keyid="test-key-ecc-p256"
172-
Signature: sig-b24=:0Ry6HsvzS5VmA6HlfBYS/fYYeNs7fYuA7s0tAdxfUlPGv0CSVuwrrzBOjcCFHTxVRJ01wjvSzM2BetJauj8dsw==:
172+
Signature: sig-b24=:wNmSUAhwb5LxtOtOpNa6W5xj067m5hFrj0XQ4fvpaCLx0NKocgPquLgyahnzDnDAUy5eCdlYUEkLIj+32oiasw==:
173173
174174
{"message": "good dog"}
175175
`

0 commit comments

Comments
 (0)