Skip to content

Commit a30a166

Browse files
committed
Related to PR SAML-Toolkits#269
1 parent 2e60902 commit a30a166

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/onelogin/ruby-saml/response.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ def initialize(response, options = {})
4545
@options = options
4646

4747
@soft = true
48-
if !options.empty? && !options[:settings].nil?
48+
unless options[:settings].nil?
4949
@settings = options[:settings]
50-
if !options[:settings].soft.nil?
51-
@soft = options[:settings].soft
50+
unless @settings.soft.nil?
51+
@soft = @settings.soft
5252
end
5353
end
5454

lib/onelogin/ruby-saml/slo_logoutrequest.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ def initialize(request, options = {})
3737
@options = options
3838

3939
@soft = true
40-
if !options.empty? && !options[:settings].nil?
40+
unless options[:settings].nil?
4141
@settings = options[:settings]
42-
if !options[:settings].soft.nil?
43-
@soft = options[:settings].soft
42+
unless @settings.soft.nil?
43+
@soft = @settings.soft
4444
end
4545
end
4646

@@ -213,7 +213,7 @@ def validate_request_state
213213
# @raise [ValidationError] if soft == false and validation fails
214214
#
215215
def validate_issuer
216-
return true if settings.idp_entity_id.nil? || issuer.nil?
216+
return true if settings.nil? || settings.idp_entity_id.nil? || issuer.nil?
217217

218218
unless URI.parse(issuer) == URI.parse(settings.idp_entity_id)
219219
return append_error("Doesn't match the issuer, expected: <#{settings.idp_entity_id}>, but was: <#{issuer}>")

0 commit comments

Comments
 (0)