67 references to FormatDate
Microsoft.AspNetCore.Http.Extensions (1)
HeaderDictionaryTypeExtensions.cs (1)
127
headers[name] = HeaderUtilities.
FormatDate
(value.GetValueOrDefault());
Microsoft.AspNetCore.Mvc.Core.Test (2)
FileResultHelperTest.cs (2)
405
httpContext.Request.Headers.IfModifiedSince = HeaderUtilities.
FormatDate
(ifModifiedSince);
443
httpContext.Request.Headers.IfUnmodifiedSince = HeaderUtilities.
FormatDate
(ifUnmodifiedSince);
Microsoft.AspNetCore.OutputCaching.Tests (20)
OutputCacheMiddlewareTests.cs (16)
179
context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.
FormatDate
(utcNow);
183
entry.CopyHeadersFrom(new HeaderDictionary { [HeaderNames.Date] = HeaderUtilities.
FormatDate
(value) });
217
context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.
FormatDate
(utcNow);
223
[HeaderNames.Date] = HeaderUtilities.
FormatDate
(date),
224
[HeaderNames.LastModified] = HeaderUtilities.
FormatDate
(lastModified),
260
context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.
FormatDate
(utcNow);
261
entry.CopyHeadersFrom(new HeaderDictionary { [HeaderNames.LastModified] = HeaderUtilities.
FormatDate
(utcNow + TimeSpan.FromSeconds(10)) });
281
context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.
FormatDate
(utcNow);
282
context.CachedResponse.CopyHeadersFrom(new HeaderDictionary { [HeaderNames.LastModified] = HeaderUtilities.
FormatDate
(utcNow - TimeSpan.FromSeconds(10)) });
433
context.HttpContext.Response.Headers.Expires = HeaderUtilities.
FormatDate
(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11));
461
context.HttpContext.Response.Headers.Expires = HeaderUtilities.
FormatDate
(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11));
487
context.HttpContext.Response.Headers.Expires = HeaderUtilities.
FormatDate
(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11));
547
Assert.Equal(HeaderUtilities.
FormatDate
(utcNow), context.HttpContext.Response.Headers.Date);
562
context.HttpContext.Response.Headers.Date = HeaderUtilities.
FormatDate
(utcNow);
565
Assert.Equal(HeaderUtilities.
FormatDate
(utcNow), context.HttpContext.Response.Headers.Date);
569
Assert.Equal(HeaderUtilities.
FormatDate
(responseTime), context.HttpContext.Response.Headers.Date);
OutputCachePolicyProviderTests.cs (4)
339
context.HttpContext.Response.Headers.Date = HeaderUtilities.
FormatDate
(utcNow);
361
context.HttpContext.Response.Headers.Expires = HeaderUtilities.
FormatDate
(utcNow);
362
context.HttpContext.Response.Headers.Date = HeaderUtilities.
FormatDate
(utcNow);
385
context.HttpContext.Response.Headers.Date = HeaderUtilities.
FormatDate
(utcNow);
Microsoft.AspNetCore.ResponseCaching (1)
ResponseCachingMiddleware.cs (1)
301
headers.Date = HeaderUtilities.
FormatDate
(context.ResponseDate.Value);
Microsoft.AspNetCore.ResponseCaching.Tests (36)
ResponseCachingMiddlewareTests.cs (22)
195
context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.
FormatDate
(utcNow);
198
context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.
FormatDate
(utcNow - TimeSpan.FromSeconds(10));
203
context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.
FormatDate
(utcNow);
208
context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.
FormatDate
(utcNow + TimeSpan.FromSeconds(10));
226
context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.
FormatDate
(utcNow);
229
context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.
FormatDate
(utcNow + TimeSpan.FromSeconds(10));
230
context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.
FormatDate
(utcNow - TimeSpan.FromSeconds(10));
235
context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.
FormatDate
(utcNow + TimeSpan.FromSeconds(10));
236
context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.
FormatDate
(utcNow);
241
context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.
FormatDate
(utcNow - TimeSpan.FromSeconds(10));
242
context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.
FormatDate
(utcNow + TimeSpan.FromSeconds(10));
261
context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.
FormatDate
(utcNow);
262
context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.
FormatDate
(utcNow + TimeSpan.FromSeconds(10));
280
context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.
FormatDate
(utcNow);
281
context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.
FormatDate
(utcNow - TimeSpan.FromSeconds(10));
459
context.HttpContext.Response.Headers.Expires = HeaderUtilities.
FormatDate
(now + TimeSpan.FromSeconds(11));
484
context.HttpContext.Response.Headers.Expires = HeaderUtilities.
FormatDate
(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11));
509
context.HttpContext.Response.Headers.Expires = HeaderUtilities.
FormatDate
(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11));
631
Assert.Equal(HeaderUtilities.
FormatDate
(utcNow), context.HttpContext.Response.Headers.Date);
643
context.HttpContext.Response.Headers.Date = HeaderUtilities.
FormatDate
(utcNow);
646
Assert.Equal(HeaderUtilities.
FormatDate
(utcNow), context.HttpContext.Response.Headers.Date);
650
Assert.Equal(HeaderUtilities.
FormatDate
(utcNow), context.HttpContext.Response.Headers.Date);
ResponseCachingPolicyProviderTests.cs (14)
372
context.HttpContext.Response.Headers.Date = HeaderUtilities.
FormatDate
(utcNow);
390
context.HttpContext.Response.Headers.Expires = HeaderUtilities.
FormatDate
(utcNow);
392
context.HttpContext.Response.Headers.Date = HeaderUtilities.
FormatDate
(utcNow);
413
context.HttpContext.Response.Headers.Expires = HeaderUtilities.
FormatDate
(utcNow);
414
context.HttpContext.Response.Headers.Date = HeaderUtilities.
FormatDate
(utcNow);
433
context.HttpContext.Response.Headers.Expires = HeaderUtilities.
FormatDate
(utcNow);
434
context.HttpContext.Response.Headers.Date = HeaderUtilities.
FormatDate
(utcNow);
456
context.HttpContext.Response.Headers.Date = HeaderUtilities.
FormatDate
(utcNow);
476
context.HttpContext.Response.Headers.Date = HeaderUtilities.
FormatDate
(utcNow);
530
context.CachedResponseHeaders[HeaderNames.Expires] = HeaderUtilities.
FormatDate
(utcNow);
552
context.HttpContext.Response.Headers.Expires = HeaderUtilities.
FormatDate
(utcNow);
572
context.HttpContext.Response.Headers.Expires = HeaderUtilities.
FormatDate
(utcNow);
595
context.CachedResponseHeaders[HeaderNames.Expires] = HeaderUtilities.
FormatDate
(utcNow);
616
context.CachedResponseHeaders[HeaderNames.Expires] = HeaderUtilities.
FormatDate
(utcNow);
Microsoft.AspNetCore.Rewrite.Tests (1)
UrlActions\ChangeCookieActionTests.cs (1)
31
Assert.Equal($"Cookie=Chocolate%20Chip; expires={HeaderUtilities.
FormatDate
(now.AddMinutes(1440))}; domain=contoso.com; path=/recipes; secure; httponly", header);
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Http\DateHeaderValueManager.cs (1)
46
var dateValue = HeaderUtilities.
FormatDate
(value);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
KestrelServerTests.cs (1)
747
Assert.Equal(HeaderUtilities.
FormatDate
(testContext.FakeTimeProvider.GetUtcNow()),
Microsoft.Net.Http.Headers (2)
RangeConditionHeaderValue.cs (1)
76
return HeaderUtilities.
FormatDate
(_lastModified.GetValueOrDefault());
SetCookieHeaderValue.cs (1)
345
AppendSegment(builder, ExpiresToken, HeaderUtilities.
FormatDate
(Expires.GetValueOrDefault()));
Microsoft.Net.Http.Headers.Tests (2)
DateParserTest.cs (2)
46
HeaderUtilities.
FormatDate
(new DateTimeOffset(2010, 7, 31, 15, 38, 57, TimeSpan.Zero)));
49
HeaderUtilities.
FormatDate
(new DateTimeOffset(2010, 1, 1, 1, 1, 1, TimeSpan.Zero)));