rack-secure-referer 1.0.0 → 1.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: 4e20b686a9a758ec196f751bb6d8f947c3e56921
4
- data.tar.gz: 70f32695f58603dd3e230ec4411b50125af189c3
3
+ metadata.gz: c7bfaf175069ddb346c673e79b9dfbc171e8fb24
4
+ data.tar.gz: 25c634b2594cb6f3fc9d7b1897a73c64c87c5baf
5
5
  SHA512:
6
- metadata.gz: 6283f815c25621b9c3e94630bf98b35fb6655b29c3800f7ed192668c806c6be5b3a417d3ec0db9f9098cd988b151a7e406bbac48ccb5ddb0f678fe9ccf7ae1c5
7
- data.tar.gz: 280cc83fec5506df24a21f21a015d20dd4eb19ffdb1c05805c3700724be32fd7708b17f4f82cce0a1daa212d97f72ce0dca1ec9a306d18bca6a8a00862df5815
6
+ metadata.gz: dc96ca93b776f9aba1022ee53fc0d7d1e7df0326a619d639cf5118998d734db86b5e405723cd5f57bc7caf2d4c666528bd430a27104e91630b6c98379ec61449
7
+ data.tar.gz: 155fa8f6c6179892e8b86a5dbc1c9aa7daf417522360f18c2a05682e68103168d6e0bb65f4fb935b6276187c8f2d99c2045addcbd48fd75fbc8e1338d9b74626
data/README.md CHANGED
@@ -1,11 +1,9 @@
1
1
  # Rack::Secure::Referer
2
2
 
3
- TODO: Write a gem description
3
+ Sanitize request.referer for preventing XSS
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
8
-
9
7
  ```ruby
10
8
  gem 'rack-secure-referer'
11
9
  ```
@@ -17,15 +15,3 @@ And then execute:
17
15
  Or install it yourself as:
18
16
 
19
17
  $ gem install rack-secure-referer
20
-
21
- ## Usage
22
-
23
- TODO: Write usage instructions here
24
-
25
- ## Contributing
26
-
27
- 1. Fork it ( https://github.com/[my-github-username]/rack-secure-referer/fork )
28
- 2. Create your feature branch (`git checkout -b my-new-feature`)
29
- 3. Commit your changes (`git commit -am 'Add some feature'`)
30
- 4. Push to the branch (`git push origin my-new-feature`)
31
- 5. Create a new Pull Request
@@ -4,8 +4,9 @@ require 'rack/request'
4
4
  module Rack
5
5
  module Secure
6
6
  module Referer
7
- def new(env)
8
- unless env['HTTP_REFERER'].nil? || env['HTTP_REFERER'].match(/\Ahttp(s)?:\/\//i)
7
+ def new(*args)
8
+ env = args[0]
9
+ if !env['HTTP_REFERER'].nil? && !env['HTTP_REFERER'].match(/\Ahttp(s)?:\/\//i)
9
10
  env['HTTP_REFERER'] = nil
10
11
  end
11
12
  super
@@ -1,7 +1,7 @@
1
1
  module Rack
2
2
  module Secure
3
3
  module Referer
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-secure-referer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ppworks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-11 00:00:00.000000000 Z
11
+ date: 2017-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.4.5
108
+ rubygems_version: 2.6.11
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: Secure request.referer