nexaas-throttle 2.0.0 → 2.0.1

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
  SHA1:
3
- metadata.gz: d04c7fa7e0cf23c2a2d1381c1eb971aea3d4cc89
4
- data.tar.gz: fa011ca4b2fec123adc1f3efb834222634196c1f
3
+ metadata.gz: 7c4964a580e1a99b516bd954446768224236b885
4
+ data.tar.gz: '014842f2eec77ec70cd58ddc9fba63e8072bdb83'
5
5
  SHA512:
6
- metadata.gz: 474d0584b741c34e6a76a108d1d7a9f2b782d38e726e2a46d9fe599d6cf242c8cfff85dbe0d575ee11724f3daa0878f71568f354495bd6ccd3a38a33c9b83866
7
- data.tar.gz: 8751747095078371f503f70c084146d575466b5bad8326c262857e18655ba19258b361d0deb27c21a4680abe0f3af944452c7a2060896b7f1412d93a9f4fa7c8
6
+ metadata.gz: 0d70753f56f4f791dee1745d4ba2b4d426ae652c3bf343257fd1da442ec3fed98041b7870dd1fb78b1d31dc29abbc460c69731a382a7161c0892ac6a1b0da74e
7
+ data.tar.gz: 78bc184861a5a32fe0c618b0d6a14deff7d12c3021bf991a745f785d7f093c1e7267803d8c74cc2f61c6a76fd08241f4563bb6f5836d958fd245dc5c14f83d78
@@ -1,6 +1,8 @@
1
+ ### v2.0.1
2
+ - Fix regex matching when checking if a given request is asset-related. [#7](https://github.com/myfreecomm/nexaas-throttle/pull/7)
1
3
  ## v2.0
2
4
  - The gem no longer checks if the request is made from an API client. See [#6](https://github.com/myfreecomm/nexaas-throttle/pull/6) for discussion.
3
5
  ## v1.0
4
6
  - Allow the configuration of user-agents to ignore when throttling. [#5](https://github.com/myfreecomm/nexaas-throttle/pull/5)
5
- ### v0.1.0
7
+ ### v0.1
6
8
  - Initial commit
@@ -29,14 +29,14 @@ module Nexaas
29
29
 
30
30
  def assets?
31
31
  path = request.path
32
- path.match(/\/assets/).present? || path.match(extensions_regexp).present?
32
+ path.match(%r{/assets}).present? || path.match(extensions_regexp).present?
33
33
  end
34
34
 
35
35
  def extensions_regexp
36
36
  @assets_extensions ||= begin
37
- extensions = %w(css js png jpg gif)
38
- /\.(#{extensions.join("|")})/
39
- end
37
+ extensions_group = %w(css js png jpg gif).join("|")
38
+ /\.(#{extensions_group})(\?\S*)?$/
39
+ end
40
40
  end
41
41
 
42
42
  def ignore_user_agents?
@@ -1,5 +1,5 @@
1
1
  module Nexaas
2
2
  module Throttle
3
- VERSION = "2.0.0".freeze
3
+ VERSION = "2.0.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexaas-throttle
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wanderson Policarpo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-01 00:00:00.000000000 Z
11
+ date: 2017-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler