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

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


The following commit(s) were added to refs/heads/main by this push:
     new f73942b4897 CAMEL-22116: Make it possible for SB to provide special 
logic in getRawPath
f73942b4897 is described below

commit f73942b48973eee325430e8db13bc5e1b2e1a893
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Sat May 31 15:43:41 2025 +0200

    CAMEL-22116: Make it possible for SB to provide special logic in getRawPath
---
 .../http/springboot/SpringBootPlatformHttpBinding.java        | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git 
a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java
 
b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java
index 81a976a87b4..36a7f604c90 100644
--- 
a/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java
+++ 
b/components-starter/camel-platform-http-starter/src/main/java/org/apache/camel/component/platform/http/springboot/SpringBootPlatformHttpBinding.java
@@ -294,4 +294,15 @@ public class SpringBootPlatformHttpBinding extends 
DefaultHttpBinding {
             }
         }
     }
+
+    @Override
+    protected String getRawPath(HttpServletRequest request) {
+        String uri = request.getRequestURI();
+        String contextPath = request.getContextPath() == null ? "" : 
request.getContextPath();
+        String servletPath = request.getServletPath() == null ? "" : 
request.getServletPath();
+        if (contextPath.isEmpty()) {
+            return servletPath;
+        }
+        return uri.substring(contextPath.length() + servletPath.length());
+    }
 }

Reply via email to