Code Monkey home page Code Monkey logo

cloudfrontproxies's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cloudfrontproxies's Issues

Merge with TrustedProxy?

This is really helpful (we had the same problem for a project of ours), do you mind taking contacts to the TrustedProxy maintainer, which is discussing similar problems (fideloper/TrustedProxy#108), and try to merge the packages in a way which allows custom headers in general, with shortcuts for more common setups?

Hardcoded HEADER_X_FORWARDED_ALL Constant

Hello @jdavidbakr

Thanks for writing this package.

Looking at the code I've noticed the HEADER_X_FORWARDED_ALL is hard coded into the middleware. Is this required for the package to work?

Would it be better to follow a similar pattern to Fidelopers Trusted Proxy middleware to set the constant in a class variable which then the user can extend and overwrite according to their needs.

I've also seen that Symfony are deprecating the HEADER_X_FORWARDED_ALL in version 5.2 of their HTTP package

Happy to create a PR if you broadly agree?

Must configure CloudFront to set Cloudfront-Forwarded-Proto

readme.md implies that you only need to enable this code in your Laravel middleware configuration, but you also have to configure CloudFront to actually set Cloudfront-Forwarded-Proto (in Behaviours - Whitelist headers). It doesn't set it by default, and then the middleware doesn't detect the request as coming from Cloudfront.

In my case I don't need X-Forwarded-Proto to be set properly, as I'm using https everywhere. I think it would be better to test for X-Amz-Cf-Id to be sure it's a Cloudfront request than to look for Cloudfront-Forwarded-Proto.

Either way the doc should mention that you have to manually set up this header.

Thanks for the code!

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.