开发者

Jetty removes Content-Encoding: gzip header

I'm 开发者_如何学Pythonusing Jetty 6.1 together with PJL Compressing Filter.

Jetty removes the following header from the response:

Content-Encoding: gzip

This causes that most browsers cannot display the page anymore and show something like this:

Error 330 (net::ERR_CONTENT_DECODING_FAILED)

The Problem does not occur when I deploy my application on Tomcat 6.0. Also, if I disable the PJL Compressing Filter, the application works.

What can I do that Jetty leaves the header in the response?


make it sure you're using the last available jetty version.

It does work with this configuration for me:

<filter>
    <filter-name>GzipFilter</filter-name>
    <filter-class>org.eclipse.jetty.servlets.GzipFilter</filter-class>
    <init-param>
      <param-name>mimeTypes</param-name>
      <param-value>text/html,text/plain,text/xml,application/xhtml+xml,text/css,application/javascript,application/json,image/svg+xml</param-value>
    </init-param>
</filter>
<filter-mapping>
    <filter-name>GzipFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜