IIS7 的自定义重定向不传递 If-Modified-Since 标头。漏洞?
我们使用以下技术来捕获所有不存在的 URL 并提供我们自己的结果页面:
<handlers>
<add name="Foo" path="foo.aspx" verb="*" type="Foo.UrlHandler" preCondition="integratedMode,runtimeVersionv2.0"/>
</handlers>
<httpErrors errorMode="Custom">
<remove statusCode="404"/>
<remove statusCode="405"/>
<error statusCode="404" path="/foo.aspx" responseMode="ExecuteURL"/>
<error statusCode="405" path="/foo.aspx" responseMode="ExecuteURL"/>
</httpErrors>
但是,当我检查哪些请求标头正在传递给 UrlHandler
时,我看到了除一个之外的所有标头: If-Modified-Since 标头未通过。我看到了所有其他的(缓存控制、接受等)。
有这方面的经验吗?这与这个问题有关:
在 IIS7 中将表单发布到 404 + HttpHandler:为什么所有 POST 数据都丢失了?
更新:我并不孤单 - http://www.webmasterworld.com/microsoft_asp_net/3935439.htm
We're using the following technique to catch all non-existing URLs and provide our own resulting page:
<handlers>
<add name="Foo" path="foo.aspx" verb="*" type="Foo.UrlHandler" preCondition="integratedMode,runtimeVersionv2.0"/>
</handlers>
<httpErrors errorMode="Custom">
<remove statusCode="404"/>
<remove statusCode="405"/>
<error statusCode="404" path="/foo.aspx" responseMode="ExecuteURL"/>
<error statusCode="405" path="/foo.aspx" responseMode="ExecuteURL"/>
</httpErrors>
However, when I check which request headers are being passed to the UrlHandler
, I see all but one: the If-Modified-Since header doesn't get passed. I see all the others though (Cache-Control, Accept, etc).
Had any experience with this? It's kind of related to this question:
Posting forms to a 404 + HttpHandler in IIS7: why has all POST data gone missing?
Update: I'm not alone - http://www.webmasterworld.com/microsoft_asp_net/3935439.htm
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了。如果有人遇到同样的问题:
我将项目更改为 .NET MVC(2,但 1-3 应该都可以)。制作了一条包罗万象的路线:
然后添加了一个 CatchAll 控制器,以完全按照我的 HttpHandler 曾经所做的那样。
Solved. In case anyone has the same problem:
I changed the project to a .NET MVC (2, but 1-3 should all do fine). Made a single route to catch-all:
Then added a single CatchAll controller to do exactly as my HttpHandler once did.