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

mattcasters 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 0aa3cd77a7 Fix Hop Server system property value parsing (#7503)
0aa3cd77a7 is described below

commit 0aa3cd77a7e31a97187c2b5d27ca2d2c0ef3a9ff
Author: Gabriel Dutra <[email protected]>
AuthorDate: Sun Jul 12 07:37:46 2026 -0700

    Fix Hop Server system property value parsing (#7503)
    
    Preserve equals signs contained in system property values and add a 
regression test for JDBC-style URLs.\n\nFixes #7502
    
    Co-authored-by: gabrieldutra <[email protected]>
---
 .../main/java/org/apache/hop/www/HopServer.java    |  2 +-
 .../java/org/apache/hop/www/HopServerTest.java     | 41 ++++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/engine/src/main/java/org/apache/hop/www/HopServer.java 
b/engine/src/main/java/org/apache/hop/www/HopServer.java
index 504ae34487..f9f8edaaac 100644
--- a/engine/src/main/java/org/apache/hop/www/HopServer.java
+++ b/engine/src/main/java/org/apache/hop/www/HopServer.java
@@ -649,7 +649,7 @@ public class HopServer implements Runnable, 
IHasHopMetadataProvider, IHopCommand
     //
     if (systemProperties != null) {
       for (String parameter : systemProperties) {
-        String[] split = parameter.split("=");
+        String[] split = parameter.split("=", 2);
         String key = split.length > 0 ? split[0] : null;
         String value = split.length > 1 ? split[1] : null;
         if (StringUtils.isNotEmpty(key) && StringUtils.isNotEmpty(value)) {
diff --git a/engine/src/test/java/org/apache/hop/www/HopServerTest.java 
b/engine/src/test/java/org/apache/hop/www/HopServerTest.java
new file mode 100644
index 0000000000..b2f3470746
--- /dev/null
+++ b/engine/src/test/java/org/apache/hop/www/HopServerTest.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hop.www;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+
+class HopServerTest {
+
+  @Test
+  void testApplySystemPropertiesPreservesEqualsSignsInValue() {
+    String key = "hop.test.connection.url";
+    String value = "jdbc:test://localhost/database?user=admin";
+    HopServer hopServer = new HopServer();
+    hopServer.setSystemProperties(new String[] {key + "=" + value});
+
+    try {
+      hopServer.applySystemProperties();
+
+      assertEquals(value, System.getProperty(key));
+    } finally {
+      System.clearProperty(key);
+    }
+  }
+}

Reply via email to