Jetty version(s)
11.0.9
Java version/vendor (use: java -version)
N/A
OS type/version
N/A
Description
When DefaultServlet is instantiated, most of the properties of its ResourceService retain their values unless they have been configured by an InitParameter. This means the behaviour can be configured programmatically on the ResourceService. However, this does not hold for the PrecompressedFormats, which are always reset to defaults if no InitParameter is set.
How to reproduce?
Given the following code, the PrecompressedFormats will be ignored:
ResourceService resourceService = new ResourceService();
resourceService.setPrecompressedFormats(new CompressedContentFormat[]{
new CompressedContentFormat("bzip2", ".bz2"),
new CompressedContentFormat("gzip", ".gz"),
new CompressedContentFormat("br", ".br")
});
ServletHolder defholder = new ServletHolder(new DefaultServlet(resourceService));
context.addServlet(defholder, "/");
Jetty version(s)
11.0.9
Java version/vendor
(use: java -version)N/A
OS type/version
N/A
Description
When
DefaultServletis instantiated, most of the properties of itsResourceServiceretain their values unless they have been configured by anInitParameter. This means the behaviour can be configured programmatically on theResourceService. However, this does not hold for thePrecompressedFormats, which are always reset to defaults if noInitParameteris set.How to reproduce?
Given the following code, the
PrecompressedFormatswill be ignored: