notsofast 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,14 +19,12 @@ module Notsofast
19
19
  status, headers, response = @app.call(env)
20
20
 
21
21
  if timestamp - @connections_timestamp > Notsofast::Config.limit_expiry
22
- puts "clearing connections cache"
23
22
  @connections_timestamp = timestamp
24
23
  @connections = {}
25
24
  end
26
25
 
27
26
  ip_address = remote_ip(env)
28
27
 
29
- puts Notsofast::Config.whitelist.include?(ip_address)
30
28
  unless Notsofast::Config.whitelist.include?(ip_address)
31
29
  if Notsofast::Config.blacklist.include?(ip_address)
32
30
  response = Rack::Response.new
@@ -35,15 +33,12 @@ module Notsofast
35
33
  response.finish
36
34
  return
37
35
  else
38
- puts "checking the content "
39
36
  if (headers["Content-Type"].nil? && Notsofast::Config.response_types.empty?) || (headers["Content-Type"].present? && Notsofast::Config.response_types.present? && Notsofast::Config.response_types.select{|r| headers["Content-Type"].include?(r)}.count > 0)
40
- puts "matched content type"
41
37
  if @connections[ip_address]
42
38
  @connections[ip_address] += 1
43
39
  else
44
40
  @connections[ip_address] = 1
45
41
  end
46
- puts @connections
47
42
 
48
43
  if @connections[ip_address] > Notsofast::Config.request_limit
49
44
  response = Rack::Response.new
@@ -1,3 +1,3 @@
1
1
  module Notsofast
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notsofast
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: