We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bae3b7 commit 42b6c4eCopy full SHA for 42b6c4e
digest.go
@@ -82,6 +82,10 @@ func validateSchemes(schemes []string) error {
82
return nil
83
}
84
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.
89
func ValidateContentDigestHeader(received []string, body *io.ReadCloser, accepted []string) error {
90
if len(accepted) == 0 {
91
return fmt.Errorf("received no digest schemes to accept")
0 commit comments