You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hop.apache.org by ha...@apache.org on 2026/03/30 05:47:57 UTC

(hop) branch main updated: Fix 301 redirect issue in WebServiceServlet causing request body loss (#6899)

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

hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git


The following commit(s) were added to refs/heads/main by this push:
     new d6b732a6e2 Fix 301 redirect issue in WebServiceServlet causing request body loss (#6899)
d6b732a6e2 is described below

commit d6b732a6e26ecf36d9bd5097896137bc0b6cd1bc
Author: Lance <le...@gmail.com>
AuthorDate: Mon Mar 30 13:47:52 2026 +0800

    Fix 301 redirect issue in WebServiceServlet causing request body loss (#6899)
    
    Signed-off-by: lance <le...@gmail.com>
---
 engine/src/main/java/org/apache/hop/www/WebServer.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/engine/src/main/java/org/apache/hop/www/WebServer.java b/engine/src/main/java/org/apache/hop/www/WebServer.java
index 273f0907ea..f55a409c5c 100644
--- a/engine/src/main/java/org/apache/hop/www/WebServer.java
+++ b/engine/src/main/java/org/apache/hop/www/WebServer.java
@@ -282,6 +282,10 @@ public class WebServer {
 
       ServletContextHandler servletContext =
           new ServletContextHandler(getContextPath(servlet), ServletContextHandler.SESSIONS);
+      // Without this setting, Jetty may issue a 301 redirect when the request URL
+      // does not exactly match the servlet context path (e.g. missing trailing "/")
+      // servlet as /hop/foo -> /hop/foo/ (see Jetty ContextHandler#setAllowNullPathInContext).
+      servletContext.setAllowNullPathInContext(true);
       contexts.addHandler(servletContext);
       ServletHolder servletHolder = new ServletHolder((Servlet) servlet);
       servletContext.addServlet(servletHolder, "/*");