绕过 http 处理程序的现有 HttpModule
设想: 我有一堆 Web 应用程序,我想通过 http 处理程序为其添加简单的 ping 功能。示例:http://myserver/foo/testfolder/ping.me
问题: 对于某些应用程序,由于自定义 HttpModule,此方法不起作用。这些模块对身份验证或某些其他处理逻辑有一定的依赖性,因此会使请求无效。
我正在尝试找到一种解决方案来使此 ping 功能正常工作,而无需对现有 HttpModule 进行任何更改。
Scenario:
I have a bunch of web applications for which I want to add a simple ping functionality via http handler. Example: Http://myserver/foo/testfolder/ping.me
Problem:
For some of the applications this approach does not work becasue of custom HttpModule. These modules have some depedency on either authentication or some other processing logic due to which it makes the request invalid.
I am trying to find a solution to get this ping functionality work without making any changes to existing HttpModules.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您只想禁用 ping 处理程序的 URL 的 HttpModules,您可以在 web.config 中执行此操作:
这将仅禁用给定 url 的模块。
Assuming you're wanting to disable HttpModules for only the URL to the ping handler, you can do this in your web.config:
This will disable the modules for the given url only.
HttpModule 与应用程序实例关联并适用于所有子文件夹。
因此你无法绕过它。
HttpModules are associated with the application instance and applies to all sub folders.
Hence you cannot bypass it.