lib/rack/contrib/access.rb in rack-contrib-2.3.0 vs lib/rack/contrib/access.rb in rack-contrib-2.4.0

- old
+ new

@@ -38,11 +38,11 @@ unless location[0] == ?/ raise ArgumentError, "paths need to start with /" end location = location.chomp('/') - match = Regexp.new("^#{Regexp.quote(location).gsub('/', '/+')}(.*)", nil, 'n') + match = Regexp.new("^#{Regexp.quote(location).gsub('/', '/+')}(.*)", Regexp::NOENCODING) ipmasks.collect! do |ipmask| ipmask.is_a?(IPAddr) ? ipmask : IPAddr.new(ipmask) end [host, location, match, ipmasks] @@ -70,10 +70,10 @@ end nil end def forbidden! - [403, { 'Content-Type' => 'text/html', 'Content-Length' => '0' }, []] + [403, { 'content-type' => 'text/html', 'content-length' => '0' }, []] end def ip_authorized?(request, ipmasks) return true if ipmasks.nil?