class Rack::Utils::HeaderHash
:nodoc:
@api private
header when set.
A wrapper around Headers
def self.[](headers)
- Api: - private
def self.[](headers) warn "Rack::Utils::HeaderHash is deprecated and will be removed in Rack 3.1, switch to Rack::Headers", uplevel: 1 if headers.is_a?(Headers) && !headers.frozen? return headers end new_headers = Headers.new headers.each{|k,v| new_headers[k] = v} new_headers end
def self.allocate
def self.allocate raise TypeError, "cannot allocate HeaderHash" end
def self.new(hash = {})
def self.new(hash = {}) warn "Rack::Utils::HeaderHash is deprecated and will be removed in Rack 3.1, switch to Rack::Headers", uplevel: 1 headers = Headers.new hash.each{|k,v| headers[k] = v} headers end