fight-for-net-neutrality 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/fight_for_net_neutrality.rb +5 -4
  2. metadata +3 -3
@@ -14,16 +14,15 @@ class FightForNetNeutrality
14
14
 
15
15
  def call(env)
16
16
  req = Rack::Request.new(env)
17
- if @ips_banned.any? {|ips| ips.include? req.ip }
17
+ ooo = (env["HTTP_X_FIREWALL"] || "").include? "OpenOffice"
18
+ if @ips_banned.any? {|ips| ips.include? req.ip } || ooo
18
19
  [403, {"Content-Type" => "text/html; charset=utf8"}, [@html]]
19
20
  else
20
21
  @app.call(env)
21
22
  end
22
23
  end
23
- end
24
-
25
24
 
26
- HTML = <<-EOS
25
+ HTML = <<-EOS
27
26
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
28
27
  <html>
29
28
  <head>
@@ -61,3 +60,5 @@ basiquement à s'attaquer à la liberté d'expression du peuple et devrait
61
60
  </body>
62
61
  </html>
63
62
  EOS
63
+
64
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fight-for-net-neutrality
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bruno Michel