Skip to content

Commit

Permalink
fix: ignore tracing specific headers when sending requests to deploym…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
alekseyvdovenko committed Nov 15, 2024
1 parent 605ac59 commit 021a4d0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public class ProxyUtil {
.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS)
.build();

private static final MultiMap TRACE_HEADERS = MultiMap.caseInsensitiveMultiMap()
.add("traceparent", "whatever")
.add("tracestate", "whatever");
private static final MultiMap HOP_BY_HOP_HEADERS = MultiMap.caseInsensitiveMultiMap()
.add(HttpHeaders.CONNECTION, "whatever")
.add(HttpHeaders.KEEP_ALIVE, "whatever")
Expand All @@ -60,7 +63,7 @@ public static void copyHeaders(MultiMap from, MultiMap to, MultiMap excludeHeade
String key = entry.getKey();
String value = entry.getValue();

if (!HOP_BY_HOP_HEADERS.contains(key) && !excludeHeaders.contains(key)) {
if (!HOP_BY_HOP_HEADERS.contains(key) && !TRACE_HEADERS.contains(key) && !excludeHeaders.contains(key)) {
to.add(key, value);
}
}
Expand Down

0 comments on commit 021a4d0

Please sign in to comment.