Comments (9)
Hello,
Do you know the IP causing this?
from legitbot.
Never mind, I can reproduce the bug
Alaz-Laptop:~ alaz$ irb -r interval_tree
Ignoring bson-4.7.1 because its extensions are not built. Try: gem pristine bson --version 4.7.1
irb(main):001:0> t = IntervalTree::Tree.new([])
irb(main):002:0> t.search(1)
=> nil
irb(main):003:0> t.search(2)
=> nil
irb(main):004:0> t = IntervalTree::Tree.new([(0...3)])
irb(main):005:0> t.search(2)
=> [0...3]
irb(main):006:0> t.search(7)
=> []
from legitbot.
@xgrei just wanted to let you know. I suspect that whois
returns an empty list of Facebook's AS in your environment. You might want to investigate this further. See the commands here in Facebook documentation: https://developers.facebook.com/docs/sharing/webmasters/crawler
from legitbot.
Thanks for reply, Sorry I cannot get the problematic ip address, Can you just change the code from !ranges.empty?
to !(ranges && ranges&.empty?
from legitbot.
Could you please show the rest of the stack trace? I do not quite understand how this is possible. Do you have your own BotMatcher
with ip_ranges
?
from legitbot.
NoMethodError: undefined method `empty?' for nil:NilClass
…ms/legitbot-1.0.0/lib/legitbot/validators/ip_ranges.rb: 43:in `valid_ip?'
…ms/legitbot-1.0.0/lib/legitbot/validators/ip_ranges.rb: 20:in `valid_ip?'
…uby/2.6.0/gems/legitbot-1.0.0/lib/legitbot/botmatch.rb: 25:in `valid?'
…uby/2.6.0/gems/legitbot-1.0.0/lib/legitbot/legitbot.rb: 26:in `select'
…uby/2.6.0/gems/legitbot-1.0.0/lib/legitbot/legitbot.rb: 26:in `bot'
…200325332231/app/controllers/application_controller.rb: 160:in `check_bot'
# application_controller.rb
@is_search_bot = ::Legitbot.bot(request.user_agent, request.remote_ip)&.valid? || false
from legitbot.
client user agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.4 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.4 facebookexternalhit/1.1 Facebot Twitterbot/1.0
from legitbot.
Thank you for reporting the bug. The fix is included into version 1.0.1
from legitbot.
Thank you very much for help. :)
from legitbot.
Related Issues (20)
- Upgrade `create-pull-request` to V5
- Split Google crawlers into categories
- Possible Facebook RADB source issue? HOT 1
- NoMethodError when using valid? or fake? method with FB useragent HOT 11
- New: Marginalia
- Check that Codecov integration is working
- Run `test` workflow on `pull_requests` only
- Is API ready for 1.0 ?
- NoMethodError: undefined method `index' for nil:NilClass HOT 5
- Does AppleBot still masquerate as GoogleBot? HOT 3
- Petalbot tests are failing
- Update the list of Oracle IPs
- New: Amazon / Yahoo
- iMessageBot HOT 1
- Automate the process of updating IPs
- Mock Resolv
- Resolv issues with googlebot sometimes HOT 7
- Add missing Google crawlers HOT 4
- Add support for GPTBot
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from legitbot.