Skip to content

Commit 953cca6

Browse files
Always respect any given maxAge value.
1 parent 18f67f7 commit 953cca6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/ImageSharp.Web.Providers.Azure/Resolvers/AzureBlobStorageImageResolver.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ public async Task<ImageMetadata> GetMetaDataAsync()
3737
if (CacheControlHeaderValue.TryParse(properties.CacheControl, out CacheControlHeaderValue cacheControl))
3838
{
3939
// Weirdly passing null to TryParse returns true.
40-
TimeSpan sourceMaxAge = cacheControl?.MaxAge.GetValueOrDefault() ?? TimeSpan.Zero;
41-
if (sourceMaxAge != TimeSpan.Zero)
40+
if (cacheControl != null)
4241
{
43-
maxAge = sourceMaxAge;
42+
maxAge = cacheControl.MaxAge.GetValueOrDefault();
4443
}
4544
}
4645

0 commit comments

Comments
 (0)