We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27f3bd4 commit a25c7d9Copy full SHA for a25c7d9
src/Http/Headers/src/DateTimeFormatter.cs
src/Http/Headers/src/HeaderUtilities.cs
@@ -589,7 +589,16 @@ public static string FormatDate(DateTimeOffset dateTime)
589
590
public static string FormatDate(DateTimeOffset dateTime, bool quoted)
591
{
592
- return dateTime.ToRfc1123String(quoted);
+ if (quoted)
593
+ {
594
+ return string.Create(31, dateTime, (span, dt) =>
595
596
+ span[0] = span[30] = '"';
597
+ dt.TryFormat(span.Slice(1), out _, "r");
598
+ });
599
+ }
600
+
601
+ return dateTime.ToString("r");
602
}
603
604
public static StringSegment RemoveQuotes(StringSegment input)
0 commit comments