diff --git a/src/System.Net.Http.Formatting/FormattingUtilities.cs b/src/System.Net.Http.Formatting/FormattingUtilities.cs index dd61bcf39..220ce1d89 100644 --- a/src/System.Net.Http.Formatting/FormattingUtilities.cs +++ b/src/System.Net.Http.Formatting/FormattingUtilities.cs @@ -30,8 +30,9 @@ internal static class FormattingUtilities "d MMM yy H:m:s 'GMT'", // RFC 1123, no day-of-week, short year "d MMM yy H:m:s", // RFC 1123, no day-of-week, short year, no zone - "dddd, d'-'MMM'-'yy H:m:s 'GMT'", // RFC 850 + "dddd, d'-'MMM'-'yy H:m:s 'GMT'", // RFC 850, short year "dddd, d'-'MMM'-'yy H:m:s", // RFC 850 no zone + "ddd, d'-'MMM'-'yyyy H:m:s 'GMT'", // RFC 850, long year "ddd MMM d H:m:s yyyy", // ANSI C's asctime() format "ddd, d MMM yyyy H:m:s zzz", // RFC 5322 diff --git a/test/System.Net.Http.Formatting.Test/FormattingUtilitiesTests.cs b/test/System.Net.Http.Formatting.Test/FormattingUtilitiesTests.cs index 4ba3ff109..19115542b 100644 --- a/test/System.Net.Http.Formatting.Test/FormattingUtilitiesTests.cs +++ b/test/System.Net.Http.Formatting.Test/FormattingUtilitiesTests.cs @@ -100,6 +100,7 @@ public static TheoryDataSet ValidDateValues // RFC850 date/time value { "Sunday, 06-Nov-94 08:49:37 GMT", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }, { "Sunday, 6-Nov-94 8:49:37", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }, + { "Sun, 6-Nov-1994 8:49:37 GMT", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }, // ANSI C's asctime() format { "Sun Nov 06 08:49:37 1994", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) },