You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2026/06/24 17:33:51 UTC

(tomcat) branch main updated: Complete changes required for ".war" extension to be case insensitive

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 9cba69c86b Complete changes required for ".war" extension to be case insensitive
9cba69c86b is described below

commit 9cba69c86baec4a4b8eb73d4dbd4a2f1f0d31c97
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jun 24 18:32:35 2026 +0100

    Complete changes required for ".war" extension to be case insensitive
    
    (within the context of the WarFarmDeployer)
---
 java/org/apache/catalina/ha/deploy/FarmWarDeployer.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
index ba20be8392..f7b04b7265 100644
--- a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
+++ b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java
@@ -228,7 +228,7 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,
                     // last message received war file is completed
                     String name = factory.getFile().getName();
                     if (!name.endsWith(".war")) {
-                        name = name + ".war";
+                        name = (new ContextName(name, true)).getBaseName() + ".war";
                     }
                     File deployable = new File(getDeployDirFile(), name);
                     try {
@@ -419,8 +419,9 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer,
     @Override
     public void fileModified(File newWar) {
         try {
-            File deployWar = new File(getDeployDirFile(), newWar.getName());
-            ContextName cn = new ContextName(deployWar.getName(), true);
+            ContextName cn = new ContextName(newWar.getName(), true);
+            // Ensure deployed war uses lower case ".war" extension
+            File deployWar = new File(getDeployDirFile(), cn.getBaseName() + ".war");
             if (deployWar.exists() && deployWar.lastModified() > newWar.lastModified()) {
                 if (log.isInfoEnabled()) {
                     log.info(sm.getString("farmWarDeployer.alreadyDeployed", cn.getName()));


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org