Skip to content

Commit 4f44ceb

Browse files
Fixed if-else clause that had duplicate code
1 parent f62058c commit 4f44ceb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/io/github/delirius325/jmeter/backendlistener/elasticsearch/ElasticSearchMetric.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,7 @@ private void parseHeadersAsJsonProps(boolean allReqHeaders, boolean allResHeader
221221

222222
// if not all req headers and header contains special X-tag
223223
if (header.length > 1) {
224-
if (!this.allReqHeaders && header[0].startsWith("X-es-backend")) {
225-
this.json.put(header[0].replaceAll("es-", "").trim(), header[1].trim());
226-
} else {
224+
if (!this.allReqHeaders && header[0].startsWith("X-es-backend") || this.allReqHeaders) {
227225
this.json.put(header[0].replaceAll("es-", "").trim(), header[1].trim());
228226
}
229227
}

0 commit comments

Comments
 (0)