Skip to content

Commit

Permalink
Fix tests. Update number of rules
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Sep 5, 2024
1 parent 351251a commit 1e9d6aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private static InputStream validate(InputStream uploadedInputStream, String file
private static SeekableInputStream createInputStream(InputStream uploadedInputStream, String sha1Hex,
Integer fileSize) {
InputStream inputStream = uploadedInputStream;
if (sha1Hex != null) {
if (sha1Hex != null && !sha1Hex.isEmpty()) {
MessageDigest sha1 = getDigest();
inputStream = new DigestInputStream(uploadedInputStream, sha1);
}
Expand All @@ -219,7 +219,7 @@ private static SeekableInputStream createInputStream(InputStream uploadedInputSt
try {
SeekableInputStream seekableInputStream = SeekableInputStream.getSeekableStream(inputStream,
CONVERTER_MB_TO_B * maxFileSize);
if (sha1Hex != null && !sha1Hex.equalsIgnoreCase(
if (sha1Hex != null && !sha1Hex.isEmpty() && !sha1Hex.equalsIgnoreCase(
Hex.encodeHexString(((DigestInputStream) inputStream).getMessageDigest().digest()))) {
throw new BadRequestException(String.format(
"Calculated SHA1 value %s does not match the provided value %s",
Expand Down
4 changes: 2 additions & 2 deletions tests/rest_api/tests/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class BaseClass:
("4f", "PDFA_4_F", "PDF/A-4F validation profile", 108, ("6.2.4.2", 3)),
("ua1", "PDFUA_1", "PDF/UA-1 validation profile", 104, ("7.18.8", 1)),
("ua2", "PDFUA_2", "PDF/UA-2 + Tagged PDF validation profile", 1745, ("5", 5)),
("wt1a", "WTPDF_1_0_ACCESSIBILITY", "WTPDF 1.0 Accessibility validation profile", 87, ("8.4.3", 3)),
("wt1r", "WTPDF_1_0_REUSE", "WTPDF 1.0 Reuse validation profile", 74, ("8.4.5.4", 3)),
("wt1a", "WTPDF_1_0_ACCESSIBILITY", "WTPDF 1.0 Accessibility validation profile", 1747, ("8.4.3", 3)),
("wt1r", "WTPDF_1_0_REUSE", "WTPDF 1.0 Reuse validation profile", 1734, ("8.4.5.4", 3)),
)

FLAVOURS_LIST = sorted(
Expand Down

0 comments on commit 1e9d6aa

Please sign in to comment.