阻止"System.Web.HttpException:路径'OPTIONS'被禁止"失误 [英] Blocking "System.Web.HttpException: Path 'OPTIONS' is forbidden" Errors
问题描述
我收到此错误:
System.Web.HttpException: Path 'OPTIONS' is forbidden
因为有人试图从Office产品中打开网站上的URL.此处.
because of people trying to open URLs on a website from within office products. This is well documented here.
为了实施:
<httpHandlers>
<add verb="*" path="*.xls" type="System.Web.StaticFileHandler" />
<add verb="*" path="*.xlsx" type="System.Web.StaticFileHandler" />
</httpHandlers>
我需要知道所有可能的文件扩展名.Office文件扩展名很多,但我仍然错过了一个文件扩展名,因为我仍然从以下用户代理中收到错误:Microsoft-WebDAV-MiniRedir/6.1.7601
I need to know all the possible file extensions. There are a lot of office file extensions and I have missed one out as I still get the error from a user agent of: Microsoft-WebDAV-MiniRedir/6.1.7601
是否可以为某个用户代理通配符,还是在某处有明确的文件扩展名列表?
Is there a way to wildcard this for a certain user agent, or is there a definitive list of file extensions somewhere?
推荐答案
为什么需要知道文件扩展名?尝试这样的处理程序:
Why do you need to know the file extensions? Try a handler as such:
<add path="*" verb="OPTIONS, PROPFIND" type="System.Web.StaticFileHandler" />
发现其他动词时,可以将它们添加到上面的verb属性中.
As you discover additional verbs, you can add them to the verb property above.
这篇关于阻止"System.Web.HttpException:路径'OPTIONS'被禁止"失误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!