Skip to content

Commit

Permalink
Merge pull request #131 from PhyxionNL/patch-1
Browse files Browse the repository at this point in the history
Remove DateTime conversions
  • Loading branch information
Shazwazza authored Nov 22, 2021
2 parents 0ba3ae5 + a6e33a6 commit b22ea5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Smidge/HttpExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public static void AddLastModifiedResponseHeader(this HttpResponse response, Req

public static void AddExpiresResponseHeader(this HttpResponse response, int cacheHours = 10)
{
var dateTime = DateTime.Now.AddHours(cacheHours);
response.Headers[HeaderNames.Expires] = dateTime.ToUniversalTime().ToString(HttpConstants.HttpDateFormat);
var dateTime = DateTime.UtcNow.AddHours(cacheHours);
response.Headers[HeaderNames.Expires] = dateTime.ToString(HttpConstants.HttpDateFormat);
}

public static void AddCacheControlResponseHeader(this HttpResponse response, int cacheHours = 10)
Expand Down

0 comments on commit b22ea5e

Please sign in to comment.