diff --git a/lib/rack/cors/resource.rb b/lib/rack/cors/resource.rb index 4c7da4a..4cf7303 100644 --- a/lib/rack/cors/resource.rb +++ b/lib/rack/cors/resource.rb @@ -66,7 +66,8 @@ def to_headers(env) 'access-control-max-age' => max_age.to_s } h['access-control-allow-credentials'] = 'true' if credentials - Gem.loaded_specs['rack'].version >= Gem::Version.new('3') ? h : Rack::Utils::HeaderHash.new(h) + # Gem.loaded_specs['rack'].version >= Gem::Version.new('3') ? h : Rack::Utils::HeaderHash.new(h) + (defined? Rack::Utils::HeaderHash) ? Rack::Utils::HeaderHash.new(h) : h end protected