fixes #2728; content-type header is not guaranteed to exist

Fixes #2728