rack-strip-cookies 0.0.1 → 0.0.2

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: 089256d61b8c14a2b1615c87644b6f389e0bbbdc
4
- data.tar.gz: 590ab59a3003724c63d2c01599a9b75e488cb8b6
3
+ metadata.gz: c8f7845afe771475ad4812a44369964852af03d3
4
+ data.tar.gz: 0526bd74ec9f67ce7cf439e1fcbb8bc4719f4afb
5
5
  SHA512:
6
- metadata.gz: 98d590df565141ca50a7aa3c7b9c7dc56d2b96c57acb05c4946f37e813e051202a5f9741dda04b9f3d01a0bc32d06653360be89bb66de5f38fae02cbe7ba962f
7
- data.tar.gz: 54b68cc68e8eaecbf5151b40cc461826fb28da7c06adac34e25d34581247928266cd9411a397702a1b7cb6136aa6f8b3cf10602601cf47b7eeb83da37419777e
6
+ metadata.gz: 0bc9c234235bf6e655163f0036cd0965f9f370ea3544fb93a8bedccdf1030aebc161f56e0144fc78450fc57b298c2a9bd9266b88ce5e23f14fc99533a1933418
7
+ data.tar.gz: 589231190b9aa753d17411d3394fe9363b6914eebc3eeff29b3bc41253937c44b69357b2d44a6507389d9a92786c0f4853c4f0733ad8fdece77f48ae9398f8d1
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class StripCookies
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -7,14 +7,13 @@ module Rack
7
7
  end
8
8
 
9
9
  def call(env)
10
- path = Rack::Request.new(env).path
11
- status, headers, body = @app.call(env)
10
+ path = Rack::Request.new(env).path
11
+ included = paths.include?(path)
12
+
13
+ env.delete('HTTP_COOKIE') if included
12
14
 
13
- if paths.include?(path)
14
- headers.delete('Set-Cookie')
15
- # request.session_options[:skip] = true
16
- # env.delete('HTTP_COOKIE')
17
- end
15
+ status, headers, body = @app.call(env)
16
+ headers.delete('Set-Cookie') if included
18
17
 
19
18
  [status, headers, body]
20
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-strip-cookies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Poli