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

tballison pushed a commit to branch TIKA-4809-stage-2
in repository https://gitbox.apache.org/repos/asf/tika.git

commit 0fdd6cfeaa8ca1414199c1bfe55e6d45e300ab44
Author: tallison <[email protected]>
AuthorDate: Fri Aug 7 15:41:50 2026 -0400

    TIKA-4809: Fix needsPipesParsingHelper missing /meta after its pipes 
migration
---
 .../org/apache/tika/server/core/TikaServerProcess.java  | 17 +++++++++--------
 .../apache/tika/server/core/TikaServerProcessTest.java  | 11 +++++++++++
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git 
a/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java
 
b/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java
index e5ec5e30a9..93bde62770 100644
--- 
a/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java
+++ 
b/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java
@@ -185,7 +185,7 @@ public class TikaServerProcess {
         PipesParsingHelper pipesParsingHelper = null;
         if (needsPipesParsingHelper(tikaServerConfig)) {
             pipesParsingHelper = initPipesParsingHelper(tikaServerConfig);
-            LOG.info("Pipes-based parsing enabled for /tika, /rmeta, /unpack, 
and /pipes endpoints");
+            LOG.info("Pipes-based parsing enabled for /tika, /rmeta, /unpack, 
/meta, and /pipes endpoints");
         }
 
         TikaResource tikaResource = new TikaResource(tikaLoader, serverStatus, 
pipesParsingHelper,
@@ -456,13 +456,13 @@ public class TikaServerProcess {
 
     /**
      * Determines if the shared PipesParser (wrapped in PipesParsingHelper) is 
needed
-     * based on configured endpoints. It's needed when /tika, /rmeta, /unpack, 
or /pipes
-     * are enabled (either explicitly or by default) -- all four now share one 
parser.
-     * (Note: unlike the others, /pipes also requires allowPipes to actually 
start; if
-     * it's listed without allowPipes, loadCoreProviders will refuse to start 
regardless
-     * of whether this method already triggered building the shared parser.)
+     * based on configured endpoints. It's needed when /tika, /rmeta, /unpack, 
/meta, or
+     * /pipes are enabled (either explicitly or by default) -- all five now 
share one
+     * parser. (Note: unlike the others, /pipes also requires allowPipes to 
actually
+     * start; if it's listed without allowPipes, loadCoreProviders will refuse 
to start
+     * regardless of whether this method already triggered building the shared 
parser.)
      */
-    private static boolean needsPipesParsingHelper(TikaServerConfig 
tikaServerConfig) {
+    static boolean needsPipesParsingHelper(TikaServerConfig tikaServerConfig) {
         List<String> endpoints = tikaServerConfig.getEndpoints();
         // If no endpoints specified, all default endpoints are loaded 
(including
         // tika, rmeta, and unpack; pipes too when allowPipes is set)
@@ -470,7 +470,8 @@ public class TikaServerProcess {
             return true;
         }
         return endpoints.contains("tika") || endpoints.contains("rmeta")
-                || endpoints.contains("unpack") || endpoints.contains("pipes");
+                || endpoints.contains("unpack") || endpoints.contains("pipes")
+                || endpoints.contains("meta");
     }
 
     /**
diff --git 
a/tika-server/tika-server-core/src/test/java/org/apache/tika/server/core/TikaServerProcessTest.java
 
b/tika-server/tika-server-core/src/test/java/org/apache/tika/server/core/TikaServerProcessTest.java
index 351daa770b..d7acbf6173 100644
--- 
a/tika-server/tika-server-core/src/test/java/org/apache/tika/server/core/TikaServerProcessTest.java
+++ 
b/tika-server/tika-server-core/src/test/java/org/apache/tika/server/core/TikaServerProcessTest.java
@@ -17,7 +17,9 @@
 package org.apache.tika.server.core;
 
 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -51,4 +53,13 @@ public class TikaServerProcessTest {
         assertDoesNotThrow(
                 () -> TikaServerProcess.loadCoreProviders(config(false, 
"meta"), null, null));
     }
+
+    @Test
+    public void metaAloneNeedsPipesParsingHelper() {
+        // /meta is now pipes-backed too; a config listing only "meta" (no 
tika/rmeta/
+        // unpack/pipes) must still build the shared PipesParser, or every 
/meta request
+        // hits IllegalStateException("Pipes-based parsing is not enabled").
+        assertTrue(TikaServerProcess.needsPipesParsingHelper(config(false, 
"meta")));
+        assertFalse(TikaServerProcess.needsPipesParsingHelper(config(false, 
"status")));
+    }
 }

Reply via email to