You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/09/08 22:45:58 UTC

[GitHub] [druid] somu-imply commented on a diff in pull request #13052: Expose HTTP Response headers from SqlResource

somu-imply commented on code in PR #13052:
URL: https://github.com/apache/druid/pull/13052#discussion_r966482607


##########
sql/src/main/java/org/apache/druid/sql/http/SqlResource.java:
##########
@@ -185,20 +178,24 @@ public Response doPost(
                     endLifecycle(stmt, e, os.getCount());
                   }
                 }
-            )
-            .header(SQL_QUERY_ID_RESPONSE_HEADER, sqlQueryId);
-
-        if (sqlQuery.includeHeader()) {
-          responseBuilder.header(SQL_HEADER_RESPONSE_HEADER, SQL_HEADER_VALUE);
-        }
+              }
+          )
+          .header(SQL_QUERY_ID_RESPONSE_HEADER, sqlQueryId);
 
-        return responseBuilder.build();
-      }
-      catch (Throwable e) {
-        // make sure to close yielder if anything happened before starting to serialize the response.
-        yielder0.close();
-        throw new RuntimeException(e);
+      if (sqlQuery.includeHeader()) {
+        responseBuilder.header(SQL_HEADER_RESPONSE_HEADER, SQL_HEADER_VALUE);
       }
+

Review Comment:
   should this be always added or only in case where includeHeader() is true



-- 
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@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org