You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2026/10/07 12:48:56 UTC
(tomcat) 09/19: Pass the normalized default host name to the mapper in StandardEngine
This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 5a9d14f089a4628ba58709694671d1c60c106c28
Author: opencode <re...@apache.org>
AuthorDate: Wed Oct 7 12:14:13 2026 +0200
Pass the normalized default host name to the mapper in StandardEngine
setDefaultHost() stored a lower-cased copy of its argument in the
engine field but handed the raw argument to the mapper when the engine
was already running. The mapper resolves the default host name
case-sensitively, while StandardHost lower-cases all host names and
aliases it registers, so a runtime update with a differently cased
name, for example through JMX, resolved to no host and silently
dropped the default host fallback until the next restart.
Pass the stored, normalized value, so the runtime update behaves like
the start-up lookup in MapperListener, which reads the same field.
---
java/org/apache/catalina/core/StandardEngine.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/core/StandardEngine.java b/java/org/apache/catalina/core/StandardEngine.java
index 0253537626..a41621fcfb 100644
--- a/java/org/apache/catalina/core/StandardEngine.java
+++ b/java/org/apache/catalina/core/StandardEngine.java
@@ -125,7 +125,7 @@ public class StandardEngine extends ContainerBase implements Engine {
this.defaultHost = host.toLowerCase(Locale.ENGLISH);
}
if (getState().isAvailable()) {
- service.getMapper().setDefaultHostName(host);
+ service.getMapper().setDefaultHostName(this.defaultHost);
}
support.firePropertyChange("defaultHost", oldDefaultHost, this.defaultHost);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org