rack-geofilter 0.1.1 → 0.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
  SHA1:
3
- metadata.gz: ed9f2d7407cc5a9a8b3fea61812679ffad4298ea
4
- data.tar.gz: b68c071668885d17c2763b9e9f7312526f96c476
3
+ metadata.gz: 1015351888a963bcc82a096c0bb8fedd3a47543a
4
+ data.tar.gz: e42706c70e079cde9cbc0e5748bc334bc32d26c9
5
5
  SHA512:
6
- metadata.gz: 4835c3edaaf9089e5760e03dea17ce337892f036281f49c458891932e87b7a82053312fcd73cd1e6331fd4099576113f2ac8451632703e50530bdef8cc5b87cd
7
- data.tar.gz: 0a7cc60c8c18029ad84fb18d4e6149e0053eee71dbcf5f3ba7b4612c46d9e01b5d11070ed31c11a2422f6a8ec9f9f353191313fb47b50e9975589ba05201a347
6
+ metadata.gz: 60f1fabb4f8c4f48ac2b293ec286b43d87a9d0132bc7d85dc2b530e817b3e3080307baa170b54e00c8db80c231f7a14c59ed5fd2ac716bbf9f603a8e57d27d10
7
+ data.tar.gz: 786b2ffa8546e018d8d7a941ca595a6206e749b47a29ca18a80e6d021b7035c390d3788c37d7f7bb9f146dc59e42eb730c78c30207aa67a8918c5324fa3be5b5
data/README.md CHANGED
@@ -27,6 +27,20 @@ To use with Rails, add to your ``config/application.rb`` the following line
27
27
  config.middleware.insert_before ActionDispatch::RemoteIp, Rack::Geofilter
28
28
  ```
29
29
 
30
+ Then setup the environment variable ``BLOCKED_COUNTRIES`` with a comma separated
31
+ list of the [ISO 3166-1 Alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
32
+ codes of the countries you want to block, e.g.,
33
+
34
+ ```ruby
35
+ BLOCKED_COUNTRIES="UA,RU,JP,KP,KR"
36
+ ```
37
+
38
+ This will block the traffic from those countries and return
39
+
40
+ ```
41
+ 451 Service not available in country of origin
42
+ ```
43
+
30
44
  ## Contributing
31
45
 
32
46
  Bug reports and pull requests are welcome on GitHub at https://github.com/alessio-signorini/rack-geofilter.
@@ -38,7 +38,7 @@ module Rack
38
38
  end
39
39
 
40
40
  def error_message
41
- [451, {'Content-Type' => 'application/json'}, ["Service not available in country of origin\n"]]
41
+ [451, {'Content-Type' => 'plain/text'}, ["Service not available in country of origin\n"]]
42
42
  end
43
43
 
44
44
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class Geofilter
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-geofilter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessio Signorini