iodine 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of iodine might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/iodine/http/request.rb +1 -1
- data/lib/iodine/http/response.rb +6 -2
- data/lib/iodine/http/session.rb +5 -0
- data/lib/iodine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cae62f19555de3237661fc0f47461290f31a47d
|
4
|
+
data.tar.gz: d4ee6c036d77d5ccc9cc243d2e5407609d39cc16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ae4692ca663399664b005c9fd8983d151ca14a6ba543455e497d0884eabe760b0719c1bf520ad129584260ca3229f202afe3b80b16ede4c9055077415f77e02
|
7
|
+
data.tar.gz: 311d1785ec2ff505173d2eb2e34daafd997bcdd038710223d2f69b4348363df587dd4d3ebcedeca8c9fe65f93f86b8efcbbf19796fc4604b77b80c445cdf57cb
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,14 @@ Please notice that this change log contains changes for upcoming releases as wel
|
|
8
8
|
|
9
9
|
***
|
10
10
|
|
11
|
+
Change log v.0.1.12
|
12
|
+
|
13
|
+
**Update**: Passing a hash as the cookie value will allow to set cookie parameters using the {Response#set_cookie} options. i.e.: `cookies['key']= {value: "lock", max_age: 20}`.
|
14
|
+
|
15
|
+
**Security**: set the HttpOnly flag for session id cookies.
|
16
|
+
|
17
|
+
***
|
18
|
+
|
11
19
|
Change log v.0.1.11
|
12
20
|
|
13
21
|
**Fix**: fixed the Rack server Handler, which was broken in version 0.1.10.
|
data/lib/iodine/http/request.rb
CHANGED
@@ -28,7 +28,7 @@ module Iodine
|
|
28
28
|
elsif self.has_key?( key.to_s.to_sym)
|
29
29
|
key = key.to_s.to_sym
|
30
30
|
end
|
31
|
-
@response.set_cookie key, (val.nil? ? nil : val
|
31
|
+
@response.set_cookie key, (val.nil? ? nil : val)
|
32
32
|
super
|
33
33
|
end
|
34
34
|
# overrides th [] method to allow Symbols and Strings to mix and match
|
data/lib/iodine/http/response.rb
CHANGED
@@ -126,7 +126,7 @@ module Iodine
|
|
126
126
|
def session
|
127
127
|
return @session if @session
|
128
128
|
id = request.cookies[::Iodine::Http.session_token.to_sym] || SecureRandom.uuid
|
129
|
-
set_cookie ::Iodine::Http.session_token, id, expires: (Time.now+86_400), secure:
|
129
|
+
set_cookie ::Iodine::Http.session_token, id, expires: (Time.now+86_400), secure: @request.ssl?, http_only: true
|
130
130
|
@request[:session] = @session = ::Iodine::Http::SessionManager.get(id)
|
131
131
|
end
|
132
132
|
|
@@ -199,6 +199,10 @@ module Iodine
|
|
199
199
|
#
|
200
200
|
def set_cookie name, value, params = {}
|
201
201
|
raise 'Cannot set cookies after the headers had been sent.' if headers_sent?
|
202
|
+
if value.is_a?(Hash) && value.has_key?(:value) && params.empty?
|
203
|
+
params = value
|
204
|
+
value = params.delete :value
|
205
|
+
end
|
202
206
|
name = name.to_s
|
203
207
|
raise 'Illegal cookie name' if name =~ COOKIE_NAME_REGEXP
|
204
208
|
if value.nil?
|
@@ -208,7 +212,7 @@ module Iodine
|
|
208
212
|
params[:expires] ||= (Time.now + 315360000) unless params[:max_age]
|
209
213
|
end
|
210
214
|
params[:path] ||= '/'.freeze
|
211
|
-
value = Iodine::Http::Request.encode_url(value)
|
215
|
+
value = Iodine::Http::Request.encode_url(value) # this dups the string
|
212
216
|
if params[:max_age]
|
213
217
|
value << ('; Max-Age=%s' % params[:max_age])
|
214
218
|
else
|
data/lib/iodine/http/session.rb
CHANGED
data/lib/iodine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iodine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boaz Segev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|