Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Wrong Content-Type with compressed files

I'm using Jetty 9.3.3. I have a large number of files with a custom mime-type (chemical/x-cif). I have the mime type configured in my webdefault.xml, and I've confirmed that I get the correct Content-Type response header when accessing these files.

However, I would l like to store these files as compressed versions and let the GzipHandler deliver them. I've added my mime type to the includedMimeTypes in jetty-gzip.xml, and jetty does deliver the expected gzip'd payload:

$ wget --server-response  -O - --header='Accept-Encoding: "gzip"' http://localhost:8081/2hda.cif|head -1
--2015-09-30 16:24:55--  http://localhost:8081/2hda.cif
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8081... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Vary: Accept-Encoding
  Content-Encoding: gzip
  Content-Type: application/gzip
  Last-Modified: Wed, 12 Aug 2015 12:55:16 GMT
  Accept-Ranges: bytes
  Content-Length: 11223
  Server: Jetty(9.3.3.v20150827)
Length: 11223 (11K) [application/gzip]
Saving to: ‘STDOUT’

?????????... (byte code)


However, the content-type has now changed to gzip despite requesting the non-gzip version. This prevents my _javascript_ from acting upon it properly. I need the Content-Type to match the requested extension, even if the Content-Encoding is gzip.

Thanks for the help!
-Spencer

Back to the top