简体   繁体   中英

Tomcat Manager App: Deploy fail when using IE, Chrome works

We are having a weird issue with Tomcat Manager apps on a new server. When a war file is uploaded, user path info is included in the app name.
Example: When the OMS-PRIME war is uploaded, the manager app deploys as /C:usersUserNameDesktopOMS-PRIME

This only happens when Internet Explorer is used. This does not happen if the manager app is opened using a Chrome browser. IE is our enterprise standard browser.

  • Server: Windows Server 2012R2
  • Tomcat: 8.0.35
  • Java: 1.8.0_92-b14
  • Internet Explorer 11

Any ideas?

By including un-escaped backslashes in the filename value Internet Explorer does not currently comply with RFC6266.

If you're able to use a customized version of Tomcat you could re-introduce the condition in HttpParser.unquote that simply returns the unmodified string if it does not begin with a double-quote:

Index: http://svn.apache.org/repos/asf/tomcat/tc8.5.x/trunk/java/org/apache/tomcat/util/http/parser/HttpParser.java
===================================================================
--- java/org/apache/tomcat/util/http/parser/HttpParser.java (revision 1755813)
+++ java/org/apache/tomcat/util/http/parser/HttpParser.java (working copy)
@@ -62,7 +62,7 @@
     }

     public static String unquote(String input) {
-        if (input == null || input.length() < 2) {
+        if (input == null || input.length() < 2 || input.charAt(0) != '"') {
             return input;
         }

You can also workaround this issue by modifying IE to not send the full path in the filename attribute by doing the following:

1) Internet Options
2) Security Tab
3) Select relevant zone
4) Click Custom level...
5) Under Miscellaneous change the option "Include local directory path when uploading files to a server" to Disable

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM