Fixes #173. Handle mixed-case header lookups better

git-svn-id: file:///home/svn/framework3/trunk@5271 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2008-01-06 20:06:39 +00:00
parent 481bc3fbd5
commit af9407e7b0
1 changed files with 8 additions and 3 deletions

View File

@ -58,12 +58,17 @@ class Packet::Header < Hash
#
def [](key)
begin
if ((rv = self.fetch(key)) == nil)
rv = self.dcase_hash[key.downcase]
end
rv = self.fetch(key)
rescue IndexError
rv = nil
end
if (rv == nil)
begin
rv = self.dcase_hash[key.downcase]
rescue IndexError
rv = nil
end
end
return rv
end