lotus-controller 0.5.0 → 0.5.1

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: b2ff1fea9be3ce5d7e3cb2fd0555efbf3928d0f7
4
- data.tar.gz: a7eac7e0477f45078bf77172a9c179aa712be57a
3
+ metadata.gz: 0413b759d03b437e0efcce4f19779fdcf6ba5c61
4
+ data.tar.gz: bab88cc976ff852c27d82783861f179606cb705b
5
5
  SHA512:
6
- metadata.gz: eaab2895b510bedd269fc9bb9147c50af9e742b7a99041a22bb35a767e9bd195955f377ecd8ba2e0c7452ae4776e7aba213d8f3bbfa230f8af21361658869632
7
- data.tar.gz: b25f2829ca7b31440d2e768231d9ba2c5a88a85aa09c71ffe44cadcff7c396d35cab2a7387b0a04db4aacf62bcb6a9be9a4f36759f3ca47f577c3447df695a9a
6
+ metadata.gz: 38df22371c0f3ecbe875844e2fe5f17dc549b4c845c0f8f13d1b1d938a4aa2e078afd4f5fbb565d52aba22b7f6fb883af4c05b9d8f4dc8a17da1624c5954f4df
7
+ data.tar.gz: 4ef9119f03181b485771e80f8e37d0858e2c109c84bdfe5be9723032a739f54a63e2030a0a8e538682c7cbc715bf9278acbb9f01f989b33bec16bdc2c49640cb
@@ -1,6 +1,10 @@
1
1
  # Lotus::Controller
2
2
  Complete, fast and testable actions for Rack
3
3
 
4
+ ## v0.5.1 - 2016-01-19
5
+ ### Fixed
6
+ - [Alfonso Uceda] Ensure `rack.session` cookie to not be sent twice when both `Lotus::Action::Cookies` and `Rack::Session::Cookie` are used together
7
+
4
8
  ## v0.5.0 - 2016-01-12
5
9
  ### Added
6
10
  - [Luca Guidi] Reference a raised exception in Rack env's `rack.exception`. Compatibility with exception reporting SaaS.
@@ -16,6 +16,19 @@ module Lotus
16
16
  # @api private
17
17
  HTTP_HEADER = 'HTTP_COOKIE'.freeze
18
18
 
19
+ # The key used by Rack to set the session cookie
20
+ #
21
+ # We let CookieJar to NOT take care of this cookie, but it leaves the
22
+ # responsibility to the Rack middleware that handle sessions.
23
+ #
24
+ # This prevents <tt>Set-Cookie</tt> to be sent twice.
25
+ #
26
+ # @since 0.5.1
27
+ # @api private
28
+ #
29
+ # @see https://github.com/lotus/controller/issues/138
30
+ RACK_SESSION_KEY = :'rack.session'
31
+
19
32
  # The key used by Rack to set the cookies as an Hash in the env
20
33
  #
21
34
  # @since 0.1.0
@@ -55,6 +68,7 @@ module Lotus
55
68
  #
56
69
  # @see Lotus::Action::Cookies#finish
57
70
  def finish
71
+ @cookies.delete(RACK_SESSION_KEY)
58
72
  @cookies.each { |k,v| v.nil? ? delete_cookie(k) : set_cookie(k, _merge_default_values(v)) }
59
73
  end
60
74
 
@@ -3,6 +3,6 @@ module Lotus
3
3
  # Defines the version
4
4
  #
5
5
  # @since 0.1.0
6
- VERSION = '0.5.0'.freeze
6
+ VERSION = '0.5.1'.freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lotus-controller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-01-12 00:00:00.000000000 Z
13
+ date: 2016-01-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack