Make upload header handling case-insensitive.

This change makes makes handling of headers on upload case-insensitive, so that for instance "content-type: foo" and "Content-Type: foo" are equivalent.