Skip to content

Commit fd50358

Browse files
committed
Fixes based on review
1 parent 0531cd3 commit fd50358

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/main/java/com/configcat/ConfigCatLogMessages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public static FormattableLogMessage getFetchFailedDueToUnexpectedHttpResponse(fi
174174
*/
175175
public static FormattableLogMessage getFetchFailedDueToRequestTimeout(final Integer connectTimeoutMillis, final Integer readTimeoutMillis, final Integer writeTimeoutMillis, final String cfRayId) {
176176
if (cfRayId != null) {
177-
return new FormattableLogMessage("Request timed out while trying to fetch config JSON. Timeout values: [connect: %dms, read: %dms, write: %dms] %s", connectTimeoutMillis, readTimeoutMillis, writeTimeoutMillis, ConfigCatLogMessages.getCFRayIdPostFix(cfRayId));
177+
return new FormattableLogMessage("Request timed out while trying to fetch config JSON. Timeout values: [connect: %dms, read: %dms, write: %dms] %s", connectTimeoutMillis, readTimeoutMillis, writeTimeoutMillis, ConfigCatLogMessages.getCFRayIdPostFix(cfRayId));
178178
}
179179
return new FormattableLogMessage("Request timed out while trying to fetch config JSON. Timeout values: [connect: %dms, read: %dms, write: %dms]", connectTimeoutMillis, readTimeoutMillis, writeTimeoutMillis);
180180
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,8 @@ 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 = null;
114+
String cfRayId = response.header("CF-RAY");
115115
try (ResponseBody body = response.body()) {
116-
cfRayId = response.header("CF-RAY");
117116
if (response.code() == 200) {
118117
String content = body != null ? body.string() : null;
119118
String eTag = response.header("ETag");

0 commit comments

Comments
 (0)