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

markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 1fab22be70 Follow-up to "Reset the default host when it is removed 
from the mapper"
1fab22be70 is described below

commit 1fab22be70a3317bb2f6615e9e2a015fcf08529d
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Oct 8 12:19:20 2026 +0100

    Follow-up to "Reset the default host when it is removed from the mapper"
    
    Clear the default first so a missed host lookup doesn't fallback to the
    stale default.
---
 java/org/apache/catalina/mapper/Mapper.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/mapper/Mapper.java 
b/java/org/apache/catalina/mapper/Mapper.java
index 76dbe45391..65589455f4 100644
--- a/java/org/apache/catalina/mapper/Mapper.java
+++ b/java/org/apache/catalina/mapper/Mapper.java
@@ -245,13 +245,12 @@ public final class Mapper {
         }
         MappedHost[] newHosts = new MappedHost[hosts.length - 1];
         if (removeMap(hosts, newHosts, alias)) {
-            hosts = newHosts;
             hostMapping.getRealHost().removeAlias(hostMapping);
             if (defaultHost == hostMapping) {
                 defaultHost = null;
             }
+            hosts = newHosts;
         }
-
     }
 
     /**


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to