cassette
cassette copied to clipboard
Anonymous Access Throwing Exception - Owin/MVC5
Hi,
I'm getting an exception where the page is not authenticated, e.g. login pages etc. Seems to be related to Output caching needing an IPrincipal.
in web.config i have:
<httpCookies httpOnlyCookies="true" />
<authentication mode="None" />
<anonymousIdentification enabled="true" />
URL: /cassette.axd
User:
Exception:
Object reference not set to an instance of an object;
at System.Web.HttpContext.RequestRequiresAuthorization();
at System.Web.Caching.OutputCacheModule.OnLeave(Object source, EventArgs eventArgs);
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute();
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously);
System.Web.HttpContext;RequestRequiresAuthorization;
NOTE:
It only happens when the query string version hash is appended. e.g. /cassette.axd/asset/client/jquery.js?2fc3a5a5b9fb05677e50fc3ca1fb88b4acc038cb
i.e. if i manually request /cassette.axd/asset/client/jquery.js it all works fine.
Anyone else had this??
I've not tried Cassette in MVC5 at all yet, so there's not much I can suggest right now. You'll need to dig into https://github.com/andrewdavey/cassette/blob/master/src/Cassette.Aspnet/AssetRequestHandler.cs I think.
cheers. i'll have a look.
any news about this issue?