Skip to content
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

Merged
merged 3 commits into from
Jan 15, 2023
Merged

fix: catch more bots with redirects #1174

merged 3 commits into from
Jan 15, 2023

Conversation

danielroe
Copy link
Member

Description

This catches a few more bots for redirecting direct access to server URLs

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Translations update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide related snapshots or videos.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).

@danielroe danielroe added the c: bug Something isn't working label Jan 15, 2023
@danielroe danielroe self-assigned this Jan 15, 2023
@stackblitz
Copy link

stackblitz bot commented Jan 15, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link

netlify bot commented Jan 15, 2023

Deploy Preview for elk-docs canceled.

Name Link
🔨 Latest commit b6fc3a8
🔍 Latest deploy log https://app.netlify.com/sites/elk-docs/deploys/63c408982fefa3000993d06b

@netlify
Copy link

netlify bot commented Jan 15, 2023

Deploy Preview for elk-zone ready!

Name Link
🔨 Latest commit b6fc3a8
🔍 Latest deploy log https://app.netlify.com/sites/elk-zone/deploys/63c408984b456c00088da354
😎 Deploy Preview https://deploy-preview-1174--elk-zone.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@rshigg rshigg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good 👍

@@ -1,5 +1,7 @@
import { sendRedirect } from 'h3'

const BOT_RE = /bot\b|index|spider|facebookexternalhit|baidu|crawl|wget|slurp|mediapartners-google/i
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielroe danielroe merged commit ccad8bf into main Jan 15, 2023
@danielroe danielroe deleted the fix/bottier branch January 15, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants