Remove redundant newline checking
Use Content-Type header stored in CONTENT_TYPE per RFC 3875

Normalize $_SERVER['CONTENT_TYPE'] with value from $_SERVER['HTTP_CONTENT_TYPE']