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 <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]