File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/main/java/bio/terra/common/tracing Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 14
14
import jakarta .ws .rs .ext .Provider ;
15
15
import java .io .IOException ;
16
16
import java .util .List ;
17
+ import java .util .Objects ;
17
18
import java .util .Optional ;
18
19
import org .jetbrains .annotations .Nullable ;
19
20
@@ -87,7 +88,8 @@ public String getHttpRequestMethod(ClientRequestContext clientRequestContext) {
87
88
@ Override
88
89
public List <String > getHttpRequestHeader (
89
90
ClientRequestContext clientRequestContext , String name ) {
90
- return clientRequestContext .getStringHeaders ().get (name );
91
+ return Objects .requireNonNullElse (
92
+ clientRequestContext .getStringHeaders ().get (name ), List .of ());
91
93
}
92
94
93
95
@ Nullable
@@ -104,7 +106,7 @@ public List<String> getHttpResponseHeader(
104
106
ClientRequestContext clientRequestContext ,
105
107
ClientResponseContext clientResponseContext ,
106
108
String name ) {
107
- return clientResponseContext .getHeaders ().get (name );
109
+ return Objects . requireNonNullElse ( clientResponseContext .getHeaders ().get (name ), List . of () );
108
110
}
109
111
}
110
112
}
You can’t perform that action at this time.
0 commit comments