Skip to content

Commit af16ea9

Browse files
authored
Prevent Opds2Sniffer from reading the whole blob (#482)
1 parent 3cb8e61 commit af16ea9

File tree

1 file changed

+1
-1
lines changed
  • readium/shared/src/main/java/org/readium/r2/shared/util/format

1 file changed

+1
-1
lines changed

readium/shared/src/main/java/org/readium/r2/shared/util/format/Sniffers.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public object Opds2Sniffer : FormatSniffer {
202202
format: Format,
203203
source: Readable
204204
): Try<Format, ReadError> {
205-
if (format.hasMoreThan(JsonSpecification)) {
205+
if (format.hasMoreThan(JsonSpecification) || !source.canReadWholeBlob()) {
206206
return Try.success(format)
207207
}
208208

0 commit comments

Comments
 (0)