You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/02/26 17:20:35 UTC

[GitHub] [pulsar] eolivelli commented on a change in pull request #9744: [Broker] Don't add broker-address header if response has already been committed

eolivelli commented on a change in pull request #9744:
URL: https://github.com/apache/pulsar/pull/9744#discussion_r583794831



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/web/ResponseHandlerFilter.java
##########
@@ -55,8 +56,13 @@ public ResponseHandlerFilter(PulsarService pulsar) {
     public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
             throws IOException, ServletException {
 
+        if (!response.isCommitted()) {
+            ((HttpServletResponse) response).addHeader(BROKER_ADDRESS_HEADER_NAME, brokerAddress);
+        } else {
+            LOG.warn("Cannot add header {} to request {} since it's already committed.", BROKER_ADDRESS_HEADER_NAME,
+                    request);

Review comment:
       What's the actual output of the request#toString? 
   Can we log just useful info, like client IP, METHOD and URI?




----------------------------------------------------------------
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.

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