I'm trying to set the content type of my gzipped files to be of the correct mime type, rather than application/gzip, in a filter. Here's some of my code:

```
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,  FilterChain filterChain) throws IOException, ServletException
{
    final HttpServletRequest request = (HttpServletRequest) servletRequest;
    final HttpServletResponse response = (HttpServletResponse) servletResponse;

    String reqUrl = request.getRequestURI();
    if (reqUrl.endsWith(gzExt))
    {
        response.setHeader("Content-Encoding", "gzip");
        response.setContentType("text/javascript");

        System.out.println("Set header " +reqUrl +", " + response.getContentType() );

        filterChain.doFilter(request, response);

        System.out.println("Header now: " + reqUrl + ", " + response.getContentType() );
        return;
    }
}

```

Output:

```
Set header /test.js.gz, text/javascript
Header now: /test.js.gz, application/x-gzip

```

In the browser, I see that the `content-encoding` is correctly set to `gzip`, but the `content-type` remains at `application/x-gzip`. It seems that `filterChain.doFilter()` is resetting the content type.

Any idea how to permanently reset the content type?

I don't have any other filters.