Class: RubyProxyHeaders::HeaderMap

Inherits:
Hash
  • Object
show all
Defined in:
lib/ruby_proxy_headers.rb

Overview

HTTP header map with case-insensitive lookup. Names are stored downcased, which is how Net::HTTP yields them. X-ProxyMesh-IP and x-proxymesh-ip read the same value. [], []=, fetch, delete, and key? normalize names. Other Hash methods still use the stored downcased key.

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



15
16
17
# File 'lib/ruby_proxy_headers.rb', line 15

def [](key)
  super(normalize(key))
end

#[]=(key, value) ⇒ Object



19
20
21
# File 'lib/ruby_proxy_headers.rb', line 19

def []=(key, value)
  super(normalize(key), value)
end

#delete(key) ⇒ Object



27
28
29
# File 'lib/ruby_proxy_headers.rb', line 27

def delete(key)
  super(normalize(key))
end

#fetch(key, *args, &block) ⇒ Object



23
24
25
# File 'lib/ruby_proxy_headers.rb', line 23

def fetch(key, *args, &block)
  super(normalize(key), *args, &block)
end

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/ruby_proxy_headers.rb', line 31

def key?(key)
  super(normalize(key))
end