]> git.ipfire.org Git - thirdparty/squid.git/commit
Fix header name mismatching after rev.14870
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 6 Oct 2016 21:02:32 +0000 (10:02 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 6 Oct 2016 21:02:32 +0000 (10:02 +1300)
commit1997a487f7092b0fbbded4acffb07d2b8f6c9e3d
treedae5aa2870679dbb8252c355822ad77ca9e3a819
parentafc199f98b6d102670e4dae51e3fc1795f7d6edd
Fix header name mismatching after rev.14870

When a mime header set contains two custom headers and one
name is the prefix for the other the name lookup using a
fixed length for String comparison can wrongly match the
longer header as being equal to the shorter one, since only
the identical prefix portion is compared.

To avoid this we must check that the lengths are also matching.

This also improves performance very slightly as the common
case for custom headers is to have an "X-" prefix which is
slower to compare than total length. Headers having same
length and same prefix is quite rare.
src/HttpHeader.cc