You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "hangc0276 (via GitHub)" <gi...@apache.org> on 2024/03/12 16:00:31 UTC

Re: [PR] [improve] [broker] Servlet support response compression [pulsar]

hangc0276 commented on code in PR #21667:
URL: https://github.com/apache/pulsar/pull/21667#discussion_r1521736727


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/web/WebService.java:
##########
@@ -266,6 +267,12 @@ public void addServlet(String path, ServletHolder servletHolder, boolean require
             attributeMap.forEach(context::setAttribute);
         }
         filterInitializer.addFilters(context, requiresAuthentication);
+
+        if (pulsar.getConfiguration().isHttpResponseCompressionEnabled()) {
+            GzipHandler gzipHandler = new GzipHandler();
+            context.setHandler(gzipHandler);

Review Comment:
   I checked the jetty document: https://eclipse.dev/jetty/documentation/jetty-9/index.html#gzip-filter and tested both usages. Both of them are works.
   
   I add the unit test as you described.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org