You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similarly to #162, I was getting duplicated headers with Rack::Cors. Not only with Access-Control-Allow-Origin, but also with other headers. The issue is that here Rack::Cors merges the existing headers into add_headers here:
This is a problem because headers is usually a Rack::Utils::HeaderHash, which is a case-insensitive hash. By merging it into a regular hash, the headers are now case-sensitive, allowing duplicates if they have different cases.
I think this could be solved by making this hash a HeaderHash instead of a normal hash:
Similarly to #162, I was getting duplicated headers with
Rack::Cors
. Not only withAccess-Control-Allow-Origin
, but also with other headers. The issue is that hereRack::Cors
merges the existing headers intoadd_headers
here:rack-cors/lib/rack/cors.rb
Lines 103 to 106 in 908ea29
This is a problem because
headers
is usually a Rack::Utils::HeaderHash, which is a case-insensitive hash. By merging it into a regular hash, the headers are now case-sensitive, allowing duplicates if they have different cases.I think this could be solved by making this hash a
HeaderHash
instead of a normal hash:rack-cors/lib/rack/cors/resource.rb
Lines 61 to 70 in 908ea29
The text was updated successfully, but these errors were encountered: