This is an automated email from the ASF dual-hosted git repository.
ndipiazza pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/main by this push:
new 2f8dbdfbd TIKA-4252: fix metadata issue (#1752)
2f8dbdfbd is described below
commit 2f8dbdfbdf5c52160ecfc663dfb981fea527c72e
Author: Nicholas DiPiazza <[email protected]>
AuthorDate: Thu May 9 09:34:18 2024 -0500
TIKA-4252: fix metadata issue (#1752)
Co-authored-by: Nicholas DiPiazza <[email protected]>
---
tika-core/src/main/java/org/apache/tika/pipes/PipesServer.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tika-core/src/main/java/org/apache/tika/pipes/PipesServer.java
b/tika-core/src/main/java/org/apache/tika/pipes/PipesServer.java
index 991694f88..20a5def59 100644
--- a/tika-core/src/main/java/org/apache/tika/pipes/PipesServer.java
+++ b/tika-core/src/main/java/org/apache/tika/pipes/PipesServer.java
@@ -462,7 +462,7 @@ public class PipesServer implements Runnable {
throw new IllegalArgumentException(
"fetch key has a range, but the fetcher is not a range
fetcher");
}
- Metadata metadata = new Metadata();
+ Metadata metadata = t.getMetadata() == null ? new Metadata() :
t.getMetadata();
try (InputStream stream = ((RangeFetcher)
fetcher).fetch(fetchKey.getFetchKey(),
fetchKey.getRangeStart(), fetchKey.getRangeEnd(),
metadata)) {
return parseWithStream(t, stream, metadata);
@@ -474,7 +474,7 @@ public class PipesServer implements Runnable {
write(STATUS.FETCH_EXCEPTION, ExceptionUtils.getStackTrace(e));
}
} else {
- Metadata metadata = new Metadata();
+ Metadata metadata = t.getMetadata() == null ? new Metadata() :
t.getMetadata();
try (InputStream stream =
fetcher.fetch(t.getFetchKey().getFetchKey(), metadata)) {
return parseWithStream(t, stream, metadata);
} catch (SecurityException e) {