This is an automated email from the ASF dual-hosted git repository.

apucher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 2075cbe  correct way to send headers via url conn (#7728)
2075cbe is described below

commit 2075cbef39008e0faa3b4f78d9f0a2cb47b3deb0
Author: Xiaobing <61892277+klsi...@users.noreply.github.com>
AuthorDate: Mon Nov 8 22:37:06 2021 -0800

    correct way to send headers via url conn (#7728)
---
 .../main/java/org/apache/pinot/tools/perf/PerfBenchmarkDriver.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git 
a/pinot-tools/src/main/java/org/apache/pinot/tools/perf/PerfBenchmarkDriver.java
 
b/pinot-tools/src/main/java/org/apache/pinot/tools/perf/PerfBenchmarkDriver.java
index 5c1781f..b3af753 100644
--- 
a/pinot-tools/src/main/java/org/apache/pinot/tools/perf/PerfBenchmarkDriver.java
+++ 
b/pinot-tools/src/main/java/org/apache/pinot/tools/perf/PerfBenchmarkDriver.java
@@ -430,13 +430,12 @@ public class PerfBenchmarkDriver {
 
     URLConnection conn = new URL(queryUrl).openConnection();
     conn.setDoOutput(true);
-
+    for (Map.Entry<String, String> header : headers.entrySet()) {
+      conn.setRequestProperty(header.getKey(), header.getValue());
+    }
     try (BufferedWriter writer = new BufferedWriter(
         new OutputStreamWriter(conn.getOutputStream(), 
StandardCharsets.UTF_8))) {
       String requestString = requestJson.toString();
-      for (Map.Entry<String, String> header : headers.entrySet()) {
-        writer.write(String.format("%s: %s\n", header.getKey(), 
header.getValue()));
-      }
       writer.write(requestString);
       writer.flush();
 

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to