rls_multi_tenant 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a8043bdc925d9f0e5e05d743f457e9baad7d861ccfa0f649bbc2b07f48c8958
4
- data.tar.gz: 2476c3fbd98f58f8eb50be5cfbaeb95c6219a0aba2b77b250617a8d83970e16d
3
+ metadata.gz: '08b602ae00548e9668dd3ba466c9e3feeed720c6a36aba8a6b4b592324b68670'
4
+ data.tar.gz: 3e45ea738d6b55461cd35c6c280a8a34f624cf5c47fc3de466b03d39a38a320b
5
5
  SHA512:
6
- metadata.gz: 2679ab3b6517e126ac6ba342ed6c1144af54e52bde076385ac73e5fa0d56db98dee75c4a71ad81136c0f11faf3bd1532bd5e9545c741badc34016fc0fb360244
7
- data.tar.gz: ce18b2512ba1bbd63fd78388fbf752f66ea9eb4aa44aef8f16ec5ec2982c2f4996a24511f4e613a0b41916219ab557a4b0eb3a4ca70afa7b6e1cef07b6d8f2bf
6
+ metadata.gz: 4b4415ff08af022593ad64afe9f2c1d929af6be70ce1663ba9531a5d366624e9157cd87a794ccf580721416ad77e3f3e4e1d11c0e43a2e492527a837cd0762db
7
+ data.tar.gz: e382dca5401c09de4a9287f75db4e3e8a91326450ba98295f2f2fb320b574032b70260a3dbc7908450c1d22fa6a095db63f213a02cb08dab72b633b5890cbf34
@@ -84,7 +84,7 @@ module RlsMultiTenant
84
84
  end
85
85
 
86
86
  def extract_subdomain(host)
87
- return nil if host.blank?
87
+ return nil if host.blank? || ip_host?(host)
88
88
 
89
89
  # Remove port if present
90
90
  host = host.split(':').first
@@ -97,6 +97,10 @@ module RlsMultiTenant
97
97
 
98
98
  parts.first
99
99
  end
100
+
101
+ def ip_host?(host)
102
+ !/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/.match(host).nil?
103
+ end
100
104
  end
101
105
  end
102
106
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RlsMultiTenant
4
- VERSION = '0.2.5'
4
+ VERSION = '0.2.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rls_multi_tenant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coding Ways