Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ private static void doForEachKey(
HttpMessage carrier,
akka.http.javadsl.model.HttpEntity entity,
AgentPropagation.KeyClassifier classifier) {
if (entity instanceof HttpEntity.Strict) {
HttpEntity.Strict strictEntity = (HttpEntity.Strict) entity;
ContentType contentType = strictEntity.contentType();
// In Akka HTTP, Content-Type is part of the entity, not a regular header.
// Extract it for all entity types (Default, Chunked, etc.), not only Strict.
if (entity instanceof HttpEntity) {
ContentType contentType = ((HttpEntity) entity).contentType();
if (contentType != null) {
if (!classifier.accept("content-type", contentType.value())) {
String contentTypeValue = contentType.value();
if (!contentTypeValue.isEmpty() && !classifier.accept("content-type", contentTypeValue)) {
return;
}
}
}
if (entity instanceof HttpEntity.Strict) {
HttpEntity.Strict strictEntity = (HttpEntity.Strict) entity;
if (!classifier.accept("content-length", Long.toString(strictEntity.contentLength()))) {
return;
}
Expand Down
Loading