Skip to content

Commit

Permalink
Don't generate SHA256 for empty content blocks as it's treated as an …
Browse files Browse the repository at this point in the history
…error by some clients
  • Loading branch information
Denis Trotsenko committed Sep 28, 2021
1 parent 9acaa15 commit 38dae06
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ internal object ContentBlocks {
sink: BufferedSink,
contentData: ByteArray
) = writeContentBlocks(sink, contentData, true) {
data.sha256()
if (data.isNotEmpty()) {
data.sha256()
} else {
ByteArray(32) { 0x0 }
}
}

internal fun writeContentBlocksVer4x(
Expand Down

0 comments on commit 38dae06

Please sign in to comment.