You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FileCache should either reject or consistently fix keys that conflict as filepaths #58
Currently the library allows you to specify invalid Windows filepaths as keys, for example:
varcache=newFileCache(".");cache.Add("foo","foo",DateTimeOffset.Now.AddMinutes(1));cache.Get("foo").Dump();// Returns "foo"cache.Get("foo.bar").Dump();// Also returns "foo", because the key is truncated, should return nullcache.Add(@"foo\bar",@"foo\bar",DateTimeOffset.Now.AddMinutes(1));cache.Get(@"foo\bar").Dump();// Returns "foo\bar"cache.Get(@"bar").Dump();// Also returns "foo\bar", should return null.
I'd propose that either the library should reject these as keys (if the input string != the filename), or IMO better yet it should transform them to be eligible paths. Though in this case, care must be taken so that the transformed paths don't conflict with other non-transformed keys.
Activity