IISExpress 上的错误用户代理 WP8.1

Wrong user agent WP8.1 on IISExpress

我有以下情况:

我通过 <?php echo $_SERVER['HTTP_USER_AGENT'];?> 检查了用户代理,这为 Nexus 5 生成了正确的字符串,但为 Lumia 生成了错误的字符串。在外部 ua-checker Lumia returns 上正确 "Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; tv:11.0; IEMobile/11.0; NOKIA; 909) like Gecko".

但本地 Lumia returns Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; NOKIA; 909).

这也被记录在例如 IIS 日志文件中 (IISExpress/Logs/MyWebsite/ex150112.log)

#Software: Microsoft Internet Information Services 8.0
 2015-01-12 23:28:22 ... POST /panel/login - 8080 - ... Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+Phone+OS+7.0;+Trident/3.1;+IEMobile/7.0;+NOKIA;+909) http://mycomputername:8080/panel/login 500 0 0 93

我认为 IEMobile 可能在内部使用我们从 Desktop-IE 知道的一些兼容模式。但为什么只针对这个本地站点?

长话短说,为什么 IEMobile/WP8.1 会发送错误的用户代理字符串?这是因为安装了一个奇怪的 IISExpress PHP5.5,导致错误检测吗?或者 WP8.1 是否总是将错误的 ua 发送到本地 Webmatrix 站点?或者这是 IEMobile 中的错误? 以及如何将服务器端接收到的 ua 更改为正确的 ua?

我自己修好了(来源:http://msdn.microsoft.com/de-de/cc817572.aspx) 我只是添加了一个自定义 http header 来禁用 wp8 以通过 web.config.

中的以下条目为 Intranet 站点选择兼容模式
<system.webServer>
    <httpProtocol>
         <customHeaders>
            <clear />
            <add name="X-UA-Compatible" value="IE=EDGE" />
         </customHeaders>
      </httpProtocol>
</system.webServer>