本文介绍了IE 发送 OPTIONS 文件下载请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网站上,我有一个非常基本的设置:一个只指向一个文件的a href"标签.没什么特别的:

On my site I have a very basic setup: an 'a href' tag that just points to a file. Nothing fancy:

<a href="/path/to/my/file.doc">File</a>

没有花哨的javascript,什么都没有.一些使用低于 8 的旧 IE 版本的用户在下载这样的不同文件时遇到了不稳定的问题.我能够追溯到的是 IE 将发送一个文件的 OPTIONS 请求(即使这样也不是一直).由于我没有运行 Webdav 服务器,因此我将 mod_security 设置为默认值以拒绝那些非正常标头,因此它返回 500 响应.

No fancy javascript, nothing. Some users who are using old IE versions less than 8 have been having spotty problems downloading different files like this. What I've been able to trace it back to is that IE will send an OPTIONS request for the file (and even then not all the time). Since I'm not running a Webdav server, I had mod_security set at the default to reject those non-normal header, so it returns a 500 response.

IE8、Firefox 和 Chrome 不执行 OPTIONS 请求,因此永远不会出现问题.

IE8, Firefox, and Chrome do not do an OPTIONS request and therefore never have a problem.

我是否需要在我的一端进行不同的设置,以便 IE 停止发送 OPTIONS 请求而仅发送标准的 GET 请求?

Do I need to set something up differently on my end to IE stop sending an OPTIONS request and just a standard GET request?

运行:

  • CentOS 5.3
  • Apache 2.2.8
  • mod_security 2.5.0

推荐答案

在某个时候,我发现一篇文章说 IE 将在直接文件下载时发送 OPTIONS 请求,这只是其功能的一部分.

At some point I found an article that said that IE will send the OPTIONS request on direct file downloads as just part of how it functions.

这篇关于IE 发送 OPTIONS 文件下载请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 19:08