Skip to content

Commit 2230b78

Browse files
Fixing the filepath used if the TIKA_JAR_HASH_ALGO env var is used
The TIKA_JAR_HASH_ALGO environment variable can be used to customize which hash algorithm is used for checksums of the Tika jarfile. It's primarily in use for FIPS systems on which using the default hash algorithm (MD5) will raise an exception. If the user customizes this environment variable currently, it will raise a `FileNotFoundError`, as the hash file is currently hardcoded to be an `.md5` file, and not the filetype that's actually needed.
1 parent eddf40c commit 2230b78

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tika/tika.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ def checkJarSig(tikaServerJar, jarPath):
618618
with open(jarPath, 'rb') as f:
619619
binContents = f.read()
620620
m.update(binContents)
621-
with open(jarPath + ".md5", "r") as em:
621+
with open(f"{jarPath}.{TikaJarHashAlgo}", "r") as em:
622622
existingContents = em.read()
623623
return existingContents == m.hexdigest()
624624

0 commit comments

Comments
 (0)