根据文档,问题出在 Content-Type 参数结构上,ti 应该是:
Content-Type: text/rfc822-headers; Content-Transfer-Encoding= 8bit
我刚刚创建了一个类来修复它,但我仍然认为必须有一些更好的解决方案。如果有人发现它,请继续回答!:)
谢谢
public static String cleanContentType(String contentType){
StringBuilder cleanedContentType = new StringBuilder();
if(contentType.contains(";")){ //It contains paramenter
cleanedContentType.append(contentType.split(";")[0]).append("; ");
if(contentType.split(";").length > 1){
for(int i = 1; i < contentType.split(";").length ; i++){
cleanedContentType.append(contentType.split(";")[i].replace(":", "=")).append("; ");
}
}
} else{
return contentType;
}
return cleanedContentType.toString();
}