leventov commented on a change in pull request #8157: Enum of ResponseContext 
keys
URL: https://github.com/apache/incubator-druid/pull/8157#discussion_r307381976
 
 

 ##########
 File path: server/src/main/java/org/apache/druid/server/QueryResource.java
 ##########
 @@ -252,24 +252,30 @@ public void write(OutputStream outputStream) throws 
WebApplicationException
             )
             .header("X-Druid-Query-Id", queryId);
 
-        if (responseContext.get(ResponseContext.CTX_ETAG) != null) {
-          builder.header(HEADER_ETAG, 
responseContext.get(ResponseContext.CTX_ETAG));
-          responseContext.remove(ResponseContext.CTX_ETAG);
+        if (responseContext.get(ResponseContext.Key.ETAG) != null) {
 
 Review comment:
   Double get looks awkward. It could be
   ```java
   Object entityTag = responseContext.remove(ResponseContext.Key.ETAG);
   if (entityTag != null) {
     builder.header(HEADER_ETAG, entityTag);
   }
   ```

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to