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



##########
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:
       yes it's possible. I'm simply assuming that the request.toString() 
method will provide something useful. :) This is something that isn't likely to 
happen since adding the header is now done before executing the chain.




----------------------------------------------------------------
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:
[email protected]


Reply via email to