From 3bf5979772832aacbb939c288de69c7076fc37fd Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 20 Aug 2024 19:37:29 -0500 Subject: [PATCH] Applying change to vary header --- .../server/DynamicCompressionHandler.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jetty-core/jetty-compression/jetty-compression-server/src/main/java/org/eclipse/jetty/compression/server/DynamicCompressionHandler.java b/jetty-core/jetty-compression/jetty-compression-server/src/main/java/org/eclipse/jetty/compression/server/DynamicCompressionHandler.java index f9f3e9d9ae6a..02d8481b6d2c 100644 --- a/jetty-core/jetty-compression/jetty-compression-server/src/main/java/org/eclipse/jetty/compression/server/DynamicCompressionHandler.java +++ b/jetty-core/jetty-compression/jetty-compression-server/src/main/java/org/eclipse/jetty/compression/server/DynamicCompressionHandler.java @@ -186,15 +186,15 @@ public boolean handle(final Request request, final Response response, final Call decompressionRequest = newDecompressionRequest(request, decompressEncoding, config); } - if (compressEncoding != null && config.getVary() != null) - { - // The response may vary based on the presence or lack of Accept-Encoding. - response.getHeaders().ensureField(config.getVary()); - } - // Wrap the response and callback IFF we can be deflated and will try to deflate if (compressEncoding != null) { + if (config.getVary() != null) + { + // The response may vary based on the presence or lack of Accept-Encoding. + response.getHeaders().ensureField(config.getVary()); + } + Response compression = newCompressionResponse(this, request, response, callback, compressEncoding, config); compressionResponse = compression; if (compression instanceof Callback dynamicCallback)