Skip to content

Commit

Permalink
Do not overwrite client span if incoming request has "uber-trace-id" …
Browse files Browse the repository at this point in the history
…header
  • Loading branch information
rafis committed Jan 23, 2023
1 parent 8a865d5 commit d58a495
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public HttpHeaders filter(HttpHeaders input, ServerWebExchange exchange) {
} catch (Exception ignore) {
log.error("TraceRequestHttpHeadersFilter error", ignore);
}
headersWithInput.addAll(input);
for (Map.Entry<String, List<String>> entry : input.entrySet()) {
headersWithInput.addIfAbsent(entry.getKey(), entry.getValue().get(0));
}
addHeadersWithInput(builder, headersWithInput);
return headersWithInput;
}
Expand All @@ -86,7 +88,7 @@ private void addHeadersWithInput(ServerHttpRequest.Builder builder,
.entrySet()) {
String key = entry.getKey();
List<String> value = entry.getValue();
headersWithInput.put(key, value);
headersWithInput.putIfAbsent(key, value);
}
}

Expand Down

0 comments on commit d58a495

Please sign in to comment.