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

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


The following commit(s) were added to refs/heads/11.0.x by this push:
     new 6c5274f95e Complete changes required for ".war" extension to be case 
insensitive
6c5274f95e is described below

commit 6c5274f95e8c740fb24976530b95ecad225f0be5
Author: Mark Thomas <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to