From 915b9b34d78aa68459358687af8a5fb522709a1d Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Mon, 9 Oct 2023 11:08:49 +0200 Subject: [PATCH] HTTPCLIENT-2293: Better name for the standard date pattern --- .../org/apache/hc/client5/http/utils/DateUtils.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 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 125ff53f7..4fe5decd8 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 @@ -44,27 +44,29 @@ import org.apache.hc.core5.util.Args; /** * A utility class for parsing and formatting HTTP dates as used in cookies and - * other headers. This class handles dates as defined by RFC 2616 section - * 3.3.1 as well as some other common non-standard formats. + * other headers. * * @since 4.3 */ public final class DateUtils { /** - * Date format pattern used to parse HTTP date headers in RFC 1123 format. + * @deprecated use {@link #INTERNET_MESSAGE_FORMAT} */ + @Deprecated public static final String PATTERN_RFC1123 = "EEE, dd MMM yyyy HH:mm:ss zzz"; + public static final String INTERNET_MESSAGE_FORMAT = "EEE, dd MMM yyyy HH:mm:ss zzz"; /** - * Date formatter used to parse HTTP date headers in RFC 1123 format. + * Date formatter used to parse HTTP date headers in the Internet Message Format + * specified by the HTTP protocol. * * @since 5.2 */ public static final DateTimeFormatter FORMATTER_RFC1123 = new DateTimeFormatterBuilder() .parseLenient() .parseCaseInsensitive() - .appendPattern(PATTERN_RFC1123) + .appendPattern(INTERNET_MESSAGE_FORMAT) .toFormatter(Locale.ENGLISH); /**