Fix mimetype check

* Some browsers (Firefox) include "; charset=UTF-8" in the
  `Content-Type` header, so our previous `Content-Type` check failed.
  Flask's `request.mimetype` parses this correctly, so use that instead
  of checking `Content-type` header directly.
Merge pull request #1176 from reciprocity/feature/fix-mimetype-check

Fix mimetype check