Handle null header values (DataDog/dd-trace-java#1650)

This commit is contained in:
Richard Startin 2020-07-02 10:14:39 +01:00 committed by Trask Stalnaker
parent ad1941528c
commit 95492b7392
2 changed files with 10 additions and 2 deletions

View File

@ -31,6 +31,10 @@ public class TextMapExtractAdapter implements HttpTextFormat.Getter<Headers> {
if (header == null) {
return null;
}
return new String(header.value(), StandardCharsets.UTF_8);
byte[] value = header.value();
if (value == null) {
return null;
}
return new String(value, StandardCharsets.UTF_8);
}
}

View File

@ -31,6 +31,10 @@ public class TextMapExtractAdapter implements HttpTextFormat.Getter<Headers> {
if (header == null) {
return null;
}
return new String(header.value(), StandardCharsets.UTF_8);
byte[] value = header.value();
if (value == null) {
return null;
}
return new String(value, StandardCharsets.UTF_8);
}
}