Giter Club home page Giter Club logo

Comments (9)

alaz avatar alaz commented on July 21, 2024

Hello,

Do you know the IP causing this?

from legitbot.

alaz avatar alaz commented on July 21, 2024

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.

alaz avatar alaz commented on July 21, 2024

@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.

xgrei avatar xgrei commented on July 21, 2024

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.

alaz avatar alaz commented on July 21, 2024

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.

xgrei avatar xgrei commented on July 21, 2024
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.

xgrei avatar xgrei commented on July 21, 2024

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.

alaz avatar alaz commented on July 21, 2024

Thank you for reporting the bug. The fix is included into version 1.0.1

from legitbot.

xgrei avatar xgrei commented on July 21, 2024

Thank you very much for help. :)

from legitbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.