Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Nancy.LightningCache/CacheKey/DefaultCacheKeyGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public string Get(Request request)
}
}

var removeParamKeys = query.Where(a => !_varyParams.Contains(a.Key.Replace("?", "").ToLower())).Select(a => a.Key).ToArray();
var removeParamKeys = query.Where(a => !_varyParams.Contains(a.Key.Replace("?", ""), StringComparer.OrdinalIgnoreCase)).Select(a => a.Key).ToArray();
foreach (var removeParamKey in removeParamKeys)
query.Remove(removeParamKey);

Expand Down
2 changes: 1 addition & 1 deletion Nancy.LightningCache/CacheStore/DiskCacheStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public DiskCacheStore(string cacheDirectory)
private static string Hash(string str)
{
var hasher = SHA256.Create();
var inputBytes = Encoding.ASCII.GetBytes(str);
var inputBytes = Encoding.ASCII.GetBytes(str.ToLower());
var hashBytes = hasher.ComputeHash(inputBytes);

var sb = new StringBuilder();
Expand Down
6 changes: 3 additions & 3 deletions Nancy.LightningCache/CacheStore/WebCacheStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public CachedResponse Get(string key)
if (_cache == null)
return null;

var response = _cache.Get(key) as SerializableResponse;
var response = _cache.Get(key.ToLower()) as SerializableResponse;

if (response == null)
return null;
Expand All @@ -34,7 +34,7 @@ public void Remove(string key)
if (_cache == null)
return;

_cache.Remove(key);
_cache.Remove(key.ToLower());
}

public void Set(string key, NancyContext context, DateTime absoluteExpiration)
Expand All @@ -44,7 +44,7 @@ public void Set(string key, NancyContext context, DateTime absoluteExpiration)
if(_cache == null)
return;

_cache[key] = new SerializableResponse(context.Response, absoluteExpiration);
_cache[key.ToLower()] = new SerializableResponse(context.Response, absoluteExpiration);

}
private static readonly object Lock = new object();
Expand Down