Skip to content

Commit

Permalink
fix: check if mark is supported before reset inputstream ICIJ/datasha…
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanzalu committed Jul 31, 2023
1 parent 1ecabee commit 0a770f3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 79,9 @@ public void delegateParsing(InputStream stream, ContentHandler handler, Metadata
}
}
digester.digest(tis, metadata, context);
tis.reset();
if (stream.getClass().cast(stream).markSupported()) { // Avoid mark/reset error for unsupported inputstreams
tis.reset();
}
String digest;
try {
digest = new DigestIdentifier(algorithm, Charset.defaultCharset()).generateForEmbed(embed);
Expand Down

0 comments on commit 0a770f3

Please sign in to comment.