Giter Club home page Giter Club logo

Comments (5)

alaz avatar alaz commented on July 21, 2024

Hello,

Is it possible that user_agent in call to Legitbot.bot(user_agent, ip) is nil? Please try at least bot(user_agent || '', ip) or alike.

Regards,
Alexander

from legitbot.

xgrei avatar xgrei commented on July 21, 2024

Hello,

Is it possible that user_agent in call to Legitbot.bot(user_agent, ip) is nil? Please try at least bot(user_agent || '', ip) or alike.

Regards,
Alexander

Thanks for reply, This is my code:

@is_robot = ::Legitbot.bot(request.user_agent || '', request.remote_ip)&.valid? || false

from legitbot.

alaz avatar alaz commented on July 21, 2024

Did it help? Do you still have the problem?

from legitbot.

xgrei avatar xgrei commented on July 21, 2024

Did it help? Do you still have the problem?

Yes,still have the problem

NoMethodError: undefined method `empty?' for nil:NilClass


…ms/legitbot-1.0.1/lib/legitbot/validators/ip_ranges.rb:   43:in `valid_ip?'
…ms/legitbot-1.0.1/lib/legitbot/validators/ip_ranges.rb:   20:in `valid_ip?'
…uby/2.6.0/gems/legitbot-1.0.1/lib/legitbot/botmatch.rb:   25:in `valid?'
…uby/2.6.0/gems/legitbot-1.0.1/lib/legitbot/legitbot.rb:   27:in `select'
…uby/2.6.0/gems/legitbot-1.0.1/lib/legitbot/legitbot.rb:   27:in `bot'
…200811072934/app/controllers/application_controller.rb:  164:in `check_robot'

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

I can not get client ip.

from legitbot.

alaz avatar alaz commented on July 21, 2024

It looks like another problem. I am closing this issue. Would you mind creating a new issue with the stacktrace and the description how it happens? It would help a lot if you could provide a test case.

Regards,
Alexander

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.