Skip to content

Commit 4f216ca

Browse files
Remove case sensitive option
1 parent 7378dea commit 4f216ca

5 files changed

Lines changed: 6 additions & 20 deletions

File tree

src/ImageSharp.Web/Caching/ICacheKey.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ public interface ICacheKey
1616
/// </summary>
1717
/// <param name="context">The HTTP context.</param>
1818
/// <param name="commands">The commands.</param>
19-
/// <param name="caseSensitive">If set to <c>true</c> the cache key should be generated in a case sensitive manner.</param>
2019
/// <returns>
2120
/// The cache key.
2221
/// </returns>
23-
string Create(HttpContext context, CommandCollection commands, bool caseSensitive);
22+
string Create(HttpContext context, CommandCollection commands);
2423
}
2524
}

src/ImageSharp.Web/Caching/UriAbsoluteCacheKey.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ namespace SixLabors.ImageSharp.Web.Caching
1313
public class UriAbsoluteCacheKey : ICacheKey
1414
{
1515
/// <inheritdoc/>
16-
public string Create(HttpContext context, CommandCollection commands, bool caseSensitive)
17-
{
18-
string cacheKey = UriHelper.BuildAbsolute(context.Request.Scheme, context.Request.Host, context.Request.PathBase, context.Request.Path, QueryString.Create(commands));
19-
20-
return caseSensitive ? cacheKey : cacheKey.ToLowerInvariant();
21-
}
16+
public string Create(HttpContext context, CommandCollection commands)
17+
=> UriHelper.BuildAbsolute(context.Request.Scheme, context.Request.Host, context.Request.PathBase, context.Request.Path, QueryString.Create(commands)).ToLowerInvariant();
2218
}
2319
}

src/ImageSharp.Web/Caching/UriRelativeCacheKey.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ namespace SixLabors.ImageSharp.Web.Caching
1313
public class UriRelativeCacheKey : ICacheKey
1414
{
1515
/// <inheritdoc/>
16-
public string Create(HttpContext context, CommandCollection commands, bool caseSensitive)
17-
{
18-
string cacheKey = UriHelper.BuildRelative(context.Request.PathBase, context.Request.Path, QueryString.Create(commands));
19-
20-
return caseSensitive ? cacheKey : cacheKey.ToLowerInvariant();
21-
}
16+
public string Create(HttpContext context, CommandCollection commands)
17+
=> UriHelper.BuildRelative(context.Request.PathBase, context.Request.Path, QueryString.Create(commands)).ToLowerInvariant();
2218
}
2319
}

src/ImageSharp.Web/Middleware/ImageSharpMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ private async Task ProcessRequestAsync(
269269
CommandCollection commands)
270270
{
271271
// Create a cache key and hash
272-
string cacheKey = this.cacheKey.Create(context, commands, this.options.CacheKeyCaseSensitive);
272+
string cacheKey = this.cacheKey.Create(context, commands);
273273
string cacheHash = this.cacheHash.Create(cacheKey, this.options.CachedNameLength);
274274

275275
// Check the cache, if present, not out of date and not requiring an update

src/ImageSharp.Web/Middleware/ImageSharpMiddlewareOptions.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ public class ImageSharpMiddlewareOptions
8484
/// </summary>
8585
public TimeSpan CacheMaxAge { get; set; } = TimeSpan.FromDays(365);
8686

87-
/// <summary>
88-
/// Gets or sets a value indicating whether the cache key should be case sensitive.
89-
/// </summary>
90-
public bool CacheKeyCaseSensitive { get; set; } = false;
91-
9287
/// <summary>
9388
/// Gets or sets the length of the filename to use (minus the extension) when storing
9489
/// images in the image cache. Defaults to 12 characters.

0 commit comments

Comments
 (0)