cloudflare-rails 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84dc9aec556073a4d870a4784e841e63f8a047ade776f55646617d90ae57a350
4
- data.tar.gz: b2d3411fae45afc2e4f9586dc3c9fddd966c2dab028fdef278a2e57e2fb11cca
3
+ metadata.gz: de21d6707867ee11c0af5dae9a254f95fc03e2071d07a86db0406a2c1c400fd2
4
+ data.tar.gz: 50ed388a769ce657b4b9b79d3244d6551aead94d74969bd8b1d4e0af6cc5b4cf
5
5
  SHA512:
6
- metadata.gz: 77da9de7361192e828223e3ee2da7213e8f502971b2bb503f8454e14210233bbabab107dce472d8477b0ef123bb389a8fc31b07fe0bc54d41ccbd5f0312fd474
7
- data.tar.gz: 5581a9d55303a8ec303e2e95497d87c20a973ae451f0a38bee98310dffb0d5b408d43b773808c7258acd7ad2c7a657638e874fb67a1d2c1df2bafd54a910eb72
6
+ metadata.gz: 908b5340a7335a2e26e32290a41017c512cc67fa4124eee4ec9e92b0eb525c8221c532c27e90b12ddd2ec1e994c6af0877d5b727eb0c986d130b94fd20be6bf6
7
+ data.tar.gz: 95f000b7ed2033010d400d51ad4834d025286308a887da61bb315cd7e7665452f59852b92918c702fe10dbe57281cd773041c3988b2e6c856f04a2c1ad323538
data/CHANGELOG.md CHANGED
@@ -4,6 +4,9 @@ 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.3.0] - 2021-10-22
8
+ - Better handling of malformed IP addresses (https://github.com/modosc/cloudflare-rails/pull/49)
9
+
7
10
  ## [2.2.0] - 2021-06-11
8
11
  - Fix typo in `actionpack` dependency
9
12
 
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/master.svg?style=shield)](https://circleci.com/gh/modosc/cloudflare-rails/tree/master)
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
@@ -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? { |proxy| proxy === ip } || super
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
 
@@ -1,5 +1,5 @@
1
1
  module Cloudflare
2
2
  module Rails
3
- VERSION = "2.2.0".freeze
3
+ VERSION = "2.3.0".freeze
4
4
  end
5
5
  end
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.2.0
4
+ version: 2.3.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: 2021-06-11 00:00:00.000000000 Z
11
+ date: 2021-10-22 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
data/.travis.yml DELETED
@@ -1,4 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.2.3
4
- before_install: gem install bundler -v 1.10.6