如何在自定义httpmodule中检测sharepoint爬虫

发布于 2024-12-20 02:55:09 字数 333 浏览 0 评论 0原文

我编写了一个自定义 http 模块,已成功部署到共享点。该模块背后的目的是跟踪共享点网站的用户是否接受了 EULA(在请求上下文中表示为 cookie),然后简单地将他们重定向到另一个网站(独立运行)以接受我们的 EULA 等。我目前面临的问题是,虽然使用该网站的网络浏览器的用户一切正常,一切都按预期工作,但在尝试索引该网站时,出现了 SPFarms 搜索失败等问题。我的问题基本上是,我应该如何/什么进行过滤,以确保我的模块仅针对来自网络浏览器的请求执行我的逻辑,以及如何检测任何共享点爬虫等(例如搜索服务等)?我意识到我可以对其进行硬编码以检查运行服务的用户名并检查文件路径扩展名并对其进行过滤,但这似乎是可怕的设计。如果您知道更好的方法,请告知

I have written a custom http module which I successfully deployed to sharepoint. The purpose behind this module was to track if the users to the sharepoint site had accepted an EULA (represented as a cookie in the request context) and then simply redirect them to another website (running independantly) to accept our EULA etc. The problem that I am facing at the moment, is that while users with their web-browsers using the site are fine, everything works as it should, but the trouble occurs with things like the SPFarms serch failing etc when trying to index the site. My quesiton is basically, how/what should I be filtering to ensure that my module only executes my logic for a request coming from a webbrowser and how to detect any of sharepoints crawlers etc such as the search service etc? I realize i can hardcode it to check for the username that the service is running on and check the filepath extensions and filter on that, but that seems like horrible design. please advise if you know of a better way to do this please

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

过潦 2024-12-27 02:55:09

尝试根据 Request.UserAgent 中的 User-Agent 字符串进行过滤 - 只是不要出于安全目的而依赖 User-Agent,因为它可能是伪造的。

Try filtering based on the User-Agent string, in Request.UserAgent -- just don't rely on User-Agent for security purposes, since it can be faked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文