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.