cloudflare-rails 2.2.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile +0 -4
- data/README.md +1 -1
- data/gemfiles/rails_5.2.gemfile +0 -4
- data/gemfiles/rails_6.0.gemfile +0 -4
- data/gemfiles/rails_6.1.gemfile +0 -4
- data/gemfiles/rails_7.0.gemfile +0 -4
- data/lib/cloudflare/rails/railtie.rb +9 -3
- data/lib/cloudflare/rails/version.rb +1 -1
- metadata +3 -4
- data/.travis.yml +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11110e82a65bdac6452690a323d9f7b834ec61d224dce3584d59244ae5150240
|
4
|
+
data.tar.gz: cbbd90760e1966e42d0ae0e59526228686222a0b2381deb3d41680d4e05d227e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55dad9534a826670be89601a3404d420535b92e42639e44a001e2f869711c3e7347b2d810ef00967d5f51f680e0517d0c856aa26c1caff8531988722fef00910
|
7
|
+
data.tar.gz: 45000db30d0f95515c7d69a4295a4f69d68b2285c638a24b4f1d30b79c53aa5940beb861b7dcc9c2cc75183ab039baaedc34f84510c5455abf7b68d46cc76379
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [2.4.0] - 2022-02-22
|
8
|
+
- Add trailing slashes to reflect Cloudflare API URLs (https://github.com/modosc/cloudflare-rails/pull/53)
|
9
|
+
|
10
|
+
## [2.3.0] - 2021-10-22
|
11
|
+
- Better handling of malformed IP addresses (https://github.com/modosc/cloudflare-rails/pull/49)
|
12
|
+
|
7
13
|
## [2.2.0] - 2021-06-11
|
8
14
|
- Fix typo in `actionpack` dependency
|
9
15
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Cloudflare::Rails [![Gem Version](https://badge.fury.io/rb/cloudflare-rails.svg)](https://badge.fury.io/rb/cloudflare-rails) [![CircleCI](https://circleci.com/gh/modosc/cloudflare-rails/tree/
|
1
|
+
# Cloudflare::Rails [![Gem Version](https://badge.fury.io/rb/cloudflare-rails.svg)](https://badge.fury.io/rb/cloudflare-rails) [![CircleCI](https://circleci.com/gh/modosc/cloudflare-rails/tree/main.svg?style=shield)](https://circleci.com/gh/modosc/cloudflare-rails/tree/main)
|
2
2
|
This gem correctly configures Rails for [CloudFlare](https://www.cloudflare.com) so that `request.remote_ip` / `request.ip` both work correctly.
|
3
3
|
|
4
4
|
## Rails Compatibility
|
data/gemfiles/rails_5.2.gemfile
CHANGED
data/gemfiles/rails_6.0.gemfile
CHANGED
data/gemfiles/rails_6.1.gemfile
CHANGED
data/gemfiles/rails_7.0.gemfile
CHANGED
@@ -7,7 +7,13 @@ module Cloudflare
|
|
7
7
|
# correct inside of rack and rails
|
8
8
|
module CheckTrustedProxies
|
9
9
|
def trusted_proxy?(ip)
|
10
|
-
::Rails.application.config.cloudflare.ips.any?
|
10
|
+
matching = ::Rails.application.config.cloudflare.ips.any? do |proxy|
|
11
|
+
begin
|
12
|
+
proxy === ip
|
13
|
+
rescue IPAddr::InvalidAddressError
|
14
|
+
end
|
15
|
+
end
|
16
|
+
matching || super
|
11
17
|
end
|
12
18
|
end
|
13
19
|
|
@@ -37,8 +43,8 @@ module Cloudflare
|
|
37
43
|
end
|
38
44
|
|
39
45
|
BASE_URL = 'https://www.cloudflare.com'.freeze
|
40
|
-
IPS_V4_URL = '/ips-v4'.freeze
|
41
|
-
IPS_V6_URL = '/ips-v6'.freeze
|
46
|
+
IPS_V4_URL = '/ips-v4/'.freeze
|
47
|
+
IPS_V6_URL = '/ips-v6/'.freeze
|
42
48
|
|
43
49
|
class << self
|
44
50
|
def ips_v6
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudflare-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jonathan schatz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -224,7 +224,6 @@ files:
|
|
224
224
|
- ".rubocop.yml"
|
225
225
|
- ".rubocop_airbnb.yml"
|
226
226
|
- ".rubocop_todo.yml"
|
227
|
-
- ".travis.yml"
|
228
227
|
- Appraisals
|
229
228
|
- CHANGELOG.md
|
230
229
|
- Gemfile
|
@@ -261,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
261
260
|
- !ruby/object:Gem::Version
|
262
261
|
version: '0'
|
263
262
|
requirements: []
|
264
|
-
rubygems_version: 3.2.
|
263
|
+
rubygems_version: 3.2.22
|
265
264
|
signing_key:
|
266
265
|
specification_version: 4
|
267
266
|
summary: This gem configures Rails for CloudFlare so that request.ip and request.remote_ip
|
data/.travis.yml
DELETED