This is an automated email from the ASF dual-hosted git repository.

ndipiazza pushed a commit to branch tika-grpc-3x-features
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/tika-grpc-3x-features by this 
push:
     new ced042778 TIKA-4252: fix metadata issue
ced042778 is described below

commit ced04277836de30d95e505f501a9b9aec293e20f
Author: Nicholas DiPiazza <[email protected]>
AuthorDate: Thu May 9 09:31:19 2024 -0500

    TIKA-4252: fix metadata issue
---
 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 bfd4045a0..59def749c 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) {

Reply via email to