I'm thinking it might be easier to just put these in as-is, and
assume we need to strtolower() any X-* headers for comparison.
RFC2616 (HTTP/1.1) says headers are case insensitive anyway, so we probably
shouldn't be relying on case for comparisons...
// Try to work with what we have...
$hdr_key = substr($k, 5);
$tokens = explode('_', $hdr_key);
- if (count($tokens) > 0 && strlen($hdr_key) > 2) {
+ if (count($tokens) > 0) {
foreach($tokens as $key => $value) {
- $tokens[$key] = ucfirst($value);
+ $tokens[$key] = ucfirst(strtolower($value));
}
$hdr_key = implode('-', $tokens);
$mapped_result[$hdr_key] = $v;