-
-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: catch more bots with redirects #1174
Conversation
Run & review this pull request in StackBlitz Codeflow. |
✅ Deploy Preview for elk-docs canceled.
|
✅ Deploy Preview for elk-zone ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good 👍
plugins/social.server.ts
Outdated
@@ -1,5 +1,7 @@ | |||
import { sendRedirect } from 'h3' | |||
|
|||
const BOT_RE = /bot\b|index|spider|facebookexternalhit|baidu|crawl|wget|slurp|mediapartners-google/i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const BOT_RE = /bot\b|index|spider|facebookexternalhit|baidu|crawl|wget|slurp|mediapartners-google/i | |
const BOT_RE = /bot\b|index|spider|facebookexternalhit|baiduspider|crawl|wget|slurp|mediapartners-google/i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in that case it should be caught by previous spider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Baidu spider's UA always includes baiduspider
. There's a browser made by Baidu. To avoid detecting the Baidu browser as a spider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`spider` contains `baiduspider`
Description
This catches a few more bots for redirecting direct access to server URLs
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).