[英]Undertow always add charset to Content-Type header even if it is not a text MIME type
If I try to set the content type to "image/jpg" in a servlet 如果我尝试在servlet中将内容类型设置为“image / jpg”
response.setContentType("image/jpg")
I get 我明白了
Content-Type: image/jpg;charset=ISO-8859-1
The default servlet works well instead. 默认的servlet运行良好。
How can I get rid of charset for non text mime types? 如何摆脱非文本mime类型的字符集?
问题是我使用resp.getWriter()而不是resp.getOutputStream()来提供图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.