puppetlabs/puppet — pull request #1778 by ahpook (2013-07-16 23:54:53+00:00)
Title: (#21801) Normalize headers that come through Rack

Previously, although we stripped the leading `HTTP_` from
HTTP headers which Rack turned into environment variables,
we did not restore hyphens from underscores.

The user-visible consequence of this was that the match
to detect whether profiling was request from an agent would
not work when running under Passenger, but did work under
Webrick.

This commit updates the translation routine to turn underscores
back into hyphens. It also fixes an erroneous test fixture; the
sample header 'HTTP_X-Custom-Header' would never been seen in
the wild because environment variables are not allowed to have
hyphens.