【问题标题】:Undertow always add charset to Content-Type header even if it is not a text MIME typeUndertow 总是将字符集添加到 Content-Type 标头,即使它不是文本 MIME 类型
【发布时间】:2016-10-27 06:01:54
【问题描述】:

如果我尝试在 servlet 中将内容类型设置为“image/jpg”

response.setContentType("image/jpg")

我明白了

Content-Type: image/jpg;charset=ISO-8859-1

默认的 servlet 运行良好。

如何摆脱非文本 mime 类型的字符集?

【问题讨论】:

    标签: java servlets wildfly undertow wildfly-10


    【解决方案1】:

    问题是我使用 resp.getWriter() 而不是 resp.getOutputStream() 来提供图像。

    【讨论】:

      猜你喜欢
      • 2016-10-27
      • 2020-10-05
      • 1970-01-01
      • 2014-03-09
      • 2011-10-18
      • 2019-08-27
      • 2019-04-04
      • 2021-03-25
      • 2020-04-18
      相关资源
      最近更新 更多