简体   繁体   English

Tomcat Manager App:使用IE时部署失败,Chrome正常运行

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

We are having a weird issue with Tomcat Manager apps on a new server. 新服务器上的Tomcat Manager应用程序出现了一个奇怪的问题。 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 示例:上载OMS-PRIME战争时,管理器应用程序部署为/ C:usersUserNameDesktopOMS-PRIME

This only happens when Internet Explorer is used. 这仅在使用Internet Explorer时发生。 This does not happen if the manager app is opened using a Chrome browser. 如果使用Chrome浏览器打开管理器应用程序,则不会发生这种情况。 IE is our enterprise standard browser. IE是我们的企业标准浏览器。

  • Server: Windows Server 2012R2 伺服器:Windows Server 2012R2
  • Tomcat: 8.0.35 雄猫:8.0.35
  • Java: 1.8.0_92-b14 的Java:1.8.0_92-b14
  • Internet Explorer 11 Internet Explorer 11

Any ideas? 有任何想法吗?

By including un-escaped backslashes in the filename value Internet Explorer does not currently comply with RFC6266. 通过在文件名值中包含未转义的反斜杠,Internet Explorer当前不符合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: 如果您能够使用定制版本的Tomcat,则可以在HttpParser.unquote中重新引入条件,如果条件未以双引号开头,则该条件仅返回未修改的字符串:

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: 您还可以通过执行以下操作,通过修改IE使其不发送filename属性中的完整路径来解决此问题:

1) Internet Options 1)上网选项
2) Security Tab 2)安全标签
3) Select relevant zone 3)选择相关区域
4) Click Custom level... 4)点击自定义级别...
5) Under Miscellaneous change the option "Include local directory path when uploading files to a server" to Disable 5)在“其他”下,将“将文件上传到服务器时包括本地目录路径”选项更改为“禁用”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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