Skip to content

Commit 42b6c4e

Browse files
committed
Content-Digest header - improved interface
1 parent 2bae3b7 commit 42b6c4e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

digest.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ func validateSchemes(schemes []string) error {
8282
return nil
8383
}
8484

85+
// ValidateContentDigestHeader validates that the Content-Digest header complies to policy: at least
86+
// one of the "accepted" schemes is used, and all known schemes are associated with a correct
87+
// digest of the message body. Note that "received" is a string array, typically retrieved through the
88+
// "Values" method of the header. Returns nil if validation is successful.
8589
func ValidateContentDigestHeader(received []string, body *io.ReadCloser, accepted []string) error {
8690
if len(accepted) == 0 {
8791
return fmt.Errorf("received no digest schemes to accept")

0 commit comments

Comments
 (0)