fixes #832 #196

this completely fixes #832 #196 by taking into account the fact that, `content-type` can also contain `charset` values, apart from the `content-type` itself.