File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ def sessionindex
5050
5151 # A hash of all the attributes with the response.
5252 # Multiple values will be returned in the AttributeValue#values array
53+ # in reverse order, when compared to XML
5354 def attributes
5455 @attr_statements ||= begin
5556 result = { }
@@ -62,7 +63,7 @@ def attributes
6263 values = attr_element . elements . collect ( &:text )
6364
6465 # Set up a string-like wrapper for the values array
65- attr_value = AttributeValue . new ( values . first , values )
66+ attr_value = AttributeValue . new ( values . first , values . reverse )
6667 # Merge values if the Attribute has already been seen
6768 if result [ name ]
6869 attr_value . values += result [ name ] . values
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ class RubySamlTest < Test::Unit::TestCase
237237
238238 should "return array with all attributes when asked" do
239239 response = OneLogin ::RubySaml ::Response . new ( fixture ( :response_with_multiple_attribute_values ) )
240- assert_equal [ 'value1 ' , 'value2 ' ] , response . attributes [ :another_value ] . values
240+ assert_equal [ 'value2 ' , 'value1 ' ] , response . attributes [ :another_value ] . values
241241 end
242242
243243 should "return last of multiple values when multiple Attribute tags in XML" do
You can’t perform that action at this time.
0 commit comments