Skip to content

Commit ca71995

Browse files
fix(gofeatureflag): Added Locale.ENGLISH to SimpleDateFormat for parsing the Last-Modified HTTP header (#1626)
Signed-off-by: YuXiaoFeng <43255432@qq.com> Co-authored-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
1 parent 1f641f7 commit ca71995

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/api

providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/api/GoFeatureFlagApi.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import java.util.Collections;
3636
import java.util.Date;
3737
import java.util.List;
38+
import java.util.Locale;
3839
import java.util.Map;
3940
import lombok.Builder;
4041
import lombok.extern.slf4j.Slf4j;
@@ -284,7 +285,8 @@ private Date extractLastUpdatedFromHeaders(final HttpResponse<String> response)
284285
String headerValue = response.headers()
285286
.firstValue(Const.HTTP_HEADER_LAST_MODIFIED)
286287
.orElse(null);
287-
SimpleDateFormat lastModifiedHeaderFormatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz");
288+
SimpleDateFormat lastModifiedHeaderFormatter =
289+
new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.ENGLISH);
288290
return headerValue != null ? lastModifiedHeaderFormatter.parse(headerValue) : null;
289291
} catch (Exception e) {
290292
log.debug("Error parsing Last-Modified header: {}", e.getMessage());

0 commit comments

Comments
 (0)