It's very common to use a hash of arrays so try:
headers = {
"Access-Control-Allow-Origin" => %w[
http://my.domain1.com
http://my.domain2.com
]
}
I've got a guess that it should be { "Access-Control-Allow-Origin" => [ 'a', 'b' ] * "\n" }
Looking at the RFC, the pertinent part is "5.1 Access-Control-Allow-Origin Response Header" which points to:
The Origin header field has the following syntax:
origin = "Origin:" OWS origin-list-or-null OWS
origin-list-or-null = %x6E %x75 %x6C %x6C / origin-list
origin-list = serialized-origin *( SP serialized-origin )
serialized-origin = scheme "://" host [ ":" port ]
; <scheme>, <host>, <port> from RFC 3986
So, try:
[ 'a', 'b' ] * ";"
Or, for the uninitiated:
%w[a b].join(';')