Skip to content

Commit 468fa4d

Browse files
committed
Maintain CompressionConfig useCompression method signature
1 parent ed6f655 commit 468fa4d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

java/org/apache/coyote/CompressionConfig.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,19 @@ public void setCompressionMinSize(int compressionMinSize) {
229229
this.compressionMinSize = compressionMinSize;
230230
}
231231

232+
/**
233+
* Determines if gzip compression should be enabled for the given response and if it is, sets any necessary headers to
234+
* mark it as such.
235+
*
236+
* @param request The request that triggered the response
237+
* @param response The response to consider compressing
238+
*
239+
* @return {@code true} if compression was enabled for the given response, otherwise {@code false}
240+
*/
241+
public boolean useCompression(Request request, Response response) {
242+
return this.useCompression(request, response, "gzip");
243+
}
244+
232245
/**
233246
* Determines if compression should be enabled for the given response and if it is, sets any necessary headers to
234247
* mark it as such.

0 commit comments

Comments
 (0)