This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note: This code changes in rails 5, so make sure we update before then! | |
# Written by Chris Kirk at Primer (https://goprimer.com) | |
class CloudFrontRemoteIp < ActionDispatch::RemoteIp | |
CLOUDFRONT_IP_RANGES = 'public/cloudfront-ip-ranges.json'.freeze | |
def call(env) | |
env["action_dispatch.remote_ip"] = CloudFrontGetIp.new(env, self) | |
@app.call(env) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note: This code changes in rails 5, so make sure we update before then! | |
# Written by Chris Kirk at Primer (https://goprimer.com) | |
class CloudFrontRemoteIp < ActionDispatch::RemoteIp | |
def call(env) | |
env["action_dispatch.remote_ip"] = CloudFrontGetIp.new(env, self) | |
@app.call(env) | |
end |