httpContext is null
This commit is contained in:
parent
6a5b74568b
commit
0d95262bb3
|
|
@ -50,7 +50,9 @@ public class SharpCacheAttribute : MoAttribute
|
|||
}
|
||||
|
||||
var httpContext = Services.GetRequiredService<IHttpContextAccessor>();
|
||||
if (httpContext.HttpContext.Response.Headers["Cache-Control"].ToString().Contains("no-store"))
|
||||
if (httpContext != null &&
|
||||
httpContext.HttpContext != null &&
|
||||
httpContext.HttpContext.Response.Headers["Cache-Control"].ToString().Contains("no-store"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue