flash_cookie_session 1.1.5 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ Mzc3ZmVlODI3Mjk3M2UxN2ZjMjRlZDgwZDMxNTliOGNlNTNkMzY2MQ==
5
+ data.tar.gz: !binary |-
6
+ M2ZiMmIyYWIxNzdlZjdjMGRhNGU1NjE5YmZhYjBjYzRjMGQ2NWIxNA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MmQwOGQ1NmViOTk2OWJjMWY5NzQ5M2I3ODU1NTg2YzZjOTI4Y2I3MDQxOTE2
10
+ NTVhNjBmMWM5MDViYmYxZjRhZGM5NDAzNDUyZWNhNTYwMjUzMjI4NTBmOWJj
11
+ NzIyYTgxOWM5ZjY0NzRlMWU4ZWFhN2Q0NTQ5YzJmOGFjNmU1ODU=
12
+ data.tar.gz: !binary |-
13
+ NGY0NmFmYzlhMTFmMjk2ZWI3MjM1Yjk5MjI1OWJmNGFhNDMzMGRkNTk3MDhj
14
+ ODExNjA4NWYyMDhjNzU2NDdiNDM2NWU2NDQwOWQ5MTNjZDBkNjY1M2M1Zjhl
15
+ OTA1MGI4MTA1YWM4ZDU5YWI2MDJkYWUwZDBmNDA0YjQ4MzhjNWQ=
@@ -1,12 +1,17 @@
1
1
  module FlashCookieSession
2
2
  class Middleware
3
+ USER_AGENT_MATCHER = /^(Adobe|Shockwave) Flash/.freeze
4
+ HTTP_REFERER_MATCHER = /\.swf$/.freeze
5
+
3
6
  def initialize(app, session_key = Rails.application.config.session_options[:key])
4
7
  @app = app
5
8
  @session_key = session_key
6
9
  end
7
10
 
8
11
  def call(env)
9
- if env['HTTP_USER_AGENT'] =~ /^(Adobe|Shockwave) Flash/ or env['HTTP_REFERER'] =~ /.swf/
12
+ referrer = env['HTTP_REFERER'].to_s.split('?').first
13
+
14
+ if env['HTTP_USER_AGENT'] =~ USER_AGENT_MATCHER || referrer =~ HTTP_REFERER_MATCHER
10
15
  req = Rack::Request.new(env)
11
16
  the_session_key = [ @session_key, req.params[@session_key] ].join('=').freeze if req.params[@session_key]
12
17
 
@@ -25,4 +30,4 @@ module FlashCookieSession
25
30
  @app.call(env)
26
31
  end
27
32
  end
28
- end
33
+ end
@@ -1,3 +1,3 @@
1
1
  module FlashCookieSession
2
- VERSION = "1.1.5"
2
+ VERSION = "1.1.6"
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flash_cookie_session
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
5
- prerelease:
4
+ version: 1.1.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Trevor Turk
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-25 00:00:00.000000000 Z
11
+ date: 2013-11-18 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -46,26 +43,25 @@ files:
46
43
  - lib/flash_cookie_session/version.rb
47
44
  homepage: http://rubygems.org/gems/flash_cookie_session
48
45
  licenses: []
46
+ metadata: {}
49
47
  post_install_message:
50
48
  rdoc_options: []
51
49
  require_paths:
52
50
  - lib
53
51
  required_ruby_version: !ruby/object:Gem::Requirement
54
- none: false
55
52
  requirements:
56
53
  - - ! '>='
57
54
  - !ruby/object:Gem::Version
58
55
  version: '0'
59
56
  required_rubygems_version: !ruby/object:Gem::Requirement
60
- none: false
61
57
  requirements:
62
58
  - - ! '>='
63
59
  - !ruby/object:Gem::Version
64
60
  version: '0'
65
61
  requirements: []
66
62
  rubyforge_project: flash_cookie_session
67
- rubygems_version: 1.8.23
63
+ rubygems_version: 2.1.2
68
64
  signing_key:
69
- specification_version: 3
65
+ specification_version: 4
70
66
  summary: Rails 3 cookie sessions can cooperate with Flash
71
67
  test_files: []