From 5121240ba2ec97623d8a493dd000e819d011f657 Mon Sep 17 00:00:00 2001 From: Tornike Kharaishvili Date: Wed, 19 Sep 2018 02:48:53 +0400 Subject: [PATCH 1/2] FormattingUtilities support for parsing dates in RFC 850 long year format --- src/System.Net.Http.Formatting/FormattingUtilities.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 50a61cab19fbe980c5e80d4833812bd882772c82 Mon Sep 17 00:00:00 2001 From: Tornike Kharaishvili Date: Wed, 19 Sep 2018 03:50:44 +0400 Subject: [PATCH 2/2] RFC 850 long year format related test case --- test/System.Net.Http.Formatting.Test/FormattingUtilitiesTests.cs | 1 + 1 file changed, 1 insertion(+) 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) },