lib/oversip/sip/message.rb in oversip-1.2.1 vs lib/oversip/sip/message.rb in oversip-1.3.0.dev1

- old
+ new

@@ -108,11 +108,11 @@ # Replaces the header of given _name_ with a the given _value_. # _value_ can be a single value or an array. def set_header name, value @headers[MessageParser.headerize(name)] = case value - when Array + when ::Array value else [ value.to_s ] end end @@ -133,10 +133,10 @@ # Inserts the given _value_ in the first position of header _name_. # _value_ must be a string. def insert_header name, value if hdr = @headers[k=MessageParser.headerize(name)] - hdr.insert 0, value.to_s + hdr.unshift value.to_s else #@headers[k] = [ value.to_s ] # NOTE: If the header name doesn't already exist in the mesage, insert # the new header in the first position of the Hash. @headers = { k => [ value.to_s ] }.merge! @headers