sbsm 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -1
- data/lib/sbsm/session.rb +13 -1
- data/lib/sbsm/version.rb +1 -1
- data/test/test_rack_app.rb +8 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97b5380c3233416078670d095b29e76843a7476b
|
4
|
+
data.tar.gz: 2f4f64aaf4eab500ff12dc698d1fc6249b3990af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08d78ff9c24108e41163516ed78e2a90f1697b311f00c409aec9480d7f694be12bcf3b95b73589bd84eccf982201ef5b0801fd2d7fb89656dde83d4d3ec559fc'
|
7
|
+
data.tar.gz: 1897c958748d506cf989c0057a3f86f386c8172d04855e507f8126ec38731284d8c37ad4a7b0466fb7c779a7e3e3f6c72a4446925ec0eb1d03e70e102ac8f5f2
|
data/History.txt
CHANGED
data/lib/sbsm/session.rb
CHANGED
@@ -443,7 +443,19 @@ module SBSM
|
|
443
443
|
end
|
444
444
|
end
|
445
445
|
def cookie_pairs
|
446
|
-
cookie_input.collect
|
446
|
+
cookie_input.collect do |key, value|
|
447
|
+
if value
|
448
|
+
if value.is_a?(String)
|
449
|
+
"#{key}=#{CGI.escape(value)}"
|
450
|
+
else
|
451
|
+
"#{key}=#{value}"
|
452
|
+
end
|
453
|
+
else
|
454
|
+
"#{key}="
|
455
|
+
end
|
456
|
+
end.join(';')
|
457
|
+
rescue => error
|
458
|
+
binding.pry
|
447
459
|
end
|
448
460
|
def http_headers
|
449
461
|
@state.http_headers
|
data/lib/sbsm/version.rb
CHANGED
data/test/test_rack_app.rb
CHANGED
@@ -171,16 +171,21 @@ class TestSession < Minitest::Test
|
|
171
171
|
end
|
172
172
|
def test_cookie_pairs
|
173
173
|
@session.cookie_input = { 'name_last' => 'Müller', 'name_first' => 'Cécile',
|
174
|
-
'nil_value' => nil, 'empty_string' => ''
|
175
|
-
|
174
|
+
'nil_value' => nil, 'empty_string' => '',
|
175
|
+
'boolean_true' => true,
|
176
|
+
'boolean_false' => false,
|
177
|
+
}
|
178
|
+
assert_equal('name_last=M%C3%BCller;name_first=C%C3%A9cile;nil_value=;empty_string=;boolean_true=true;boolean_false=', @session.cookie_pairs)
|
176
179
|
@request.cookies[@session.persistent_cookie_name] = @session.cookie_pairs
|
177
180
|
@session.cookie_input = {}
|
178
181
|
assert_equal({}, @session.cookie_input)
|
179
182
|
@session.process_rack(rack_request: @request)
|
180
|
-
assert_equal([:name_last, :name_first, :nil_value, :empty_string], @session.cookie_input.keys)
|
183
|
+
assert_equal([:name_last, :name_first, :nil_value, :empty_string, :boolean_true, :boolean_false], @session.cookie_input.keys)
|
181
184
|
assert_equal('Müller', @session.cookie_input[:name_last])
|
182
185
|
assert_equal('Cécile', @session.cookie_input[:name_first])
|
186
|
+
assert_equal('true', @session.cookie_input[:boolean_true])
|
183
187
|
assert_equal('', @session.cookie_input[:nil_value])
|
184
188
|
assert_equal('', @session.cookie_input[:empty_string])
|
189
|
+
assert_equal('', @session.cookie_input[:boolean_false])
|
185
190
|
end
|
186
191
|
end
|