GithubHelp home page GithubHelp logo

REMOTE_ADDR not set on ENV about agoo HOT 13 CLOSED

texpert avatar texpert commented on June 18, 2024
REMOTE_ADDR not set on ENV

from agoo.

Comments (13)

ohler55 avatar ohler55 commented on June 18, 2024 1

I’ll look into that later today.

from agoo.

ohler55 avatar ohler55 commented on June 18, 2024 1

Great, I'll add a few tests more tests and release.

from agoo.

texpert avatar texpert commented on June 18, 2024

UPDATE: I've double-checked, and authentication actually works on production, because Rack is also trying to fetch the request.ip from the HTTP_X_FORWARDED_FOR, which, as I understand, is provided by nginx or whatever server stays in front of Heroku instance with Agoo and Rails.

Still a problem in the development, or any other environment not providing HTTP_X_FORWARDED_FOR.

from agoo.

ohler55 avatar ohler55 commented on June 18, 2024

I could not find any mention of REMOTE_ADDR in the Rack spec at https://github.com/rack/rack/blob/master/SPEC.rdoc. I have no problem adding something though if it is commonly used. Is there are definition somewhere on the rules for setting the value?

from agoo.

texpert avatar texpert commented on June 18, 2024

Yes, the rules are defined by the CGI RFC-3875 - https://tools.ietf.org/html/rfc3875#section-4.1.8

from agoo.

texpert avatar texpert commented on June 18, 2024

Also, here's a good SO response on the matter - https://stackoverflow.com/a/43014286/4812102

from agoo.

ohler55 avatar ohler55 commented on June 18, 2024

Great, thanks. That helps.

from agoo.

ohler55 avatar ohler55 commented on June 18, 2024

Interesting that REMOTE_ADDR does not include the HTTP_ prefix as would be expected from the spec. I don't see any other special cases like that except for some RACK_ prefixed keys. Are you aware of any others that should be added? It also does not appear as if all the RFC 3875 environment variables are needed for the Rack::Request.

from agoo.

texpert avatar texpert commented on June 18, 2024

Yeah, this seems to be a special case, I am not aware of any other. As for the HTTP_ prefix, it is not very clear from the spec, but it seems it should not be applied to the explicitly listed in the spec variables. And, well, this spec is not a standard, as it is stated at the document start, but just a current practice of CGI.

from agoo.

ohler55 avatar ohler55 commented on June 18, 2024

The 'remote-add' branch has a candidate fix to this issue. Please give it a try.

from agoo.

texpert avatar texpert commented on June 18, 2024

Great, works like a charm!

from agoo.

ohler55 avatar ohler55 commented on June 18, 2024

Released

from agoo.

texpert avatar texpert commented on June 18, 2024

Thank you very much, @ohler55 !! 👍

from agoo.

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.