[core] fix detecting content type with charset