wafris 1.1.1 → 1.1.2

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: 73475a40b943b5e9fb0dbfd3800a1548f188e29403d86ba06a1beb5937b28a9b
4
- data.tar.gz: 45c9fefafd42733d95bb370390096925c16ffdf1eb7dfe2bca660a2e0c068782
3
+ metadata.gz: 7590310d437ae2574c37907b8c285e236b3e22686769cb2a5043a1e8a4c6171b
4
+ data.tar.gz: 4bbc22d46692a7505b37845a5c39d8b5197441c6dc8b8bf61b12622fa690d9b6
5
5
  SHA512:
6
- metadata.gz: '025458318f9afa210b624690dfa613e5a979045b8116010bbbec7b22048dd4a424e5e3d4ca51fb6473dd902ac13de7216ba48c49ecfffc2e61d8d82b886a9716'
7
- data.tar.gz: 908c8e51856c7defcf8f033f5dbbe54a06018f0a3400c67aeca715a130e69e4a89d5be537edb545597a7fdf01802c04bccc7973f44bcc510fe8d30255e398fec
6
+ metadata.gz: 89063fcce8dcd2f35c10651bccc9de6b517f2925194493673fa6e2fa672eba4a6c3bfc1444624c957a70cd3d3b401cbc743ad13a0d8981fd5f18bcbba8eb02c8
7
+ data.tar.gz: 61b32244a41efdca5cffa93f753e8bed5fdbf23849fb4f0f8773083493c3bb26e0a9cc23480584d41e674a1cb0fa749faafa428af2c741ee9d12c5fb8078c1d4
@@ -73,13 +73,18 @@ local function ip_in_cidr_range(cidr_set, ip_decimal_lexical)
73
73
  end
74
74
  end
75
75
 
76
+ local function escapePattern(s)
77
+ local patternSpecials = "[%^%$%(%)%%%.%[%]%*%+%-%?]"
78
+ return s:gsub(patternSpecials, "%%%1")
79
+ end
80
+
76
81
  local function match_by_pattern(property_abbreviation, property_value)
77
82
  local hash_name = "rules-blocked-" .. property_abbreviation
78
83
 
79
84
  local patterns = redis.call('HKEYS', hash_name)
80
85
 
81
86
  for _, pattern in ipairs(patterns) do
82
- if string.find(property_value, pattern) then
87
+ if string.find(string.lower(property_value), string.lower(escapePattern(pattern))) then
83
88
  return pattern
84
89
  end
85
90
  end
@@ -7,7 +7,7 @@ module Wafris
7
7
  end
8
8
 
9
9
  def self.suppressed_environments
10
- ['development', 'test'] + (ENV['CI'] ? ['CI'] : [])
10
+ ['test'] + (ENV['CI'] ? ['CI'] : [])
11
11
  end
12
12
 
13
13
  def self.current_environment
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wafris
4
- VERSION = "1.1.1"
4
+ VERSION = "1.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wafris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micahel Buckbee
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-09-11 00:00:00.000000000 Z
12
+ date: 2023-09-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: connection_pool