Use mime pkg to parse Content-Type

Fixes #1391