Skip to content

Commit 18689a3

Browse files
committed
Retrieve CF-RAY ID from response header in onResponse method
1 parent fd50358 commit 18689a3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/com/configcat/ConfigFetcher.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
111111

112112
@Override
113113
public void onResponse(@NotNull Call call, @NotNull Response response) {
114-
String cfRayId = response.header("CF-RAY");
114+
String cfRayId = null;
115115
try (ResponseBody body = response.body()) {
116+
cfRayId = response.header("CF-RAY");
116117
if (response.code() == 200) {
117118
String content = body != null ? body.string() : null;
118119
String eTag = response.header("ETag");

0 commit comments

Comments
 (0)