changed social bot list to array #504
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
dependencies
Epic
good first issue
hacktoberfest
help wanted
icebox
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
Osprey
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
resilience
Tom's Wishlist
type: bug
type: discussion
type: error handling
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/spee.ch#504
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix-social-botlist"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
changing social bot check back to an array instead of object, because the check needs to be non-exact.
in the below code, it only returns true if the user agent string is an exact match
in the below version, it will catch any string that contains the social bot name. e.g.
facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_u atext.php)
orTwitterbot/1.0
. This will mean a change toTwitterbot/2.0
or related will not require a change in this code.Ah that was my mistake. Guess I didn't look close enough.
You could use
if (userAgent.includes(socialBotList[i])) {
instead to make it a little simpler.