You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by mi...@apache.org on 2021/11/13 16:10:00 UTC

[httpcomponents-client] branch master updated: Apply English locale to all date header formatters

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git


The following commit(s) were added to refs/heads/master by this push:
     new f055b3e  Apply English locale to all date header formatters
f055b3e is described below

commit f055b3e83bffa4401fcbec9a19f694f84ec760ea
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Nov 13 17:09:45 2021 +0100

    Apply English locale to all date header formatters
---
 .../src/main/java/org/apache/hc/client5/http/utils/DateUtils.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/utils/DateUtils.java b/httpclient5/src/main/java/org/apache/hc/client5/http/utils/DateUtils.java
index a044201..125ff53 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/utils/DateUtils.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/utils/DateUtils.java
@@ -35,6 +35,7 @@ import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeFormatterBuilder;
 import java.time.format.DateTimeParseException;
 import java.util.Date;
+import java.util.Locale;
 import java.util.TimeZone;
 
 import org.apache.hc.core5.http.Header;
@@ -64,7 +65,7 @@ public final class DateUtils {
             .parseLenient()
             .parseCaseInsensitive()
             .appendPattern(PATTERN_RFC1123)
-            .toFormatter();
+            .toFormatter(Locale.ENGLISH);
 
     /**
      * Date format pattern used to parse HTTP date headers in RFC 1036 format.
@@ -80,7 +81,7 @@ public final class DateUtils {
             .parseLenient()
             .parseCaseInsensitive()
             .appendPattern(PATTERN_RFC1036)
-            .toFormatter();
+            .toFormatter(Locale.ENGLISH);
 
     /**
      * Date format pattern used to parse HTTP date headers in ANSI C
@@ -97,7 +98,7 @@ public final class DateUtils {
             .parseLenient()
             .parseCaseInsensitive()
             .appendPattern(PATTERN_ASCTIME)
-            .toFormatter();
+            .toFormatter(Locale.ENGLISH);
 
     /**
      * Standard date formatters: {@link #FORMATTER_RFC1123}, {@link #FORMATTER_RFC1036}, {@link #FORMATTER_ASCTIME}.