Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

DefaultServlet should not overwrite programmatically configured precompressed formats with defaults #7880

Copy link
Copy link
Closed
@markslater

Description

@markslater
Issue body actions

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, "/");

Metadata

Metadata

Assignees

Labels

BugFor general bugs on Jetty sideFor general bugs on Jetty side

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.