aspnet / BasicMiddleware

[Archived] Basic middleware components for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
169 stars 84 forks source link

Users are able to make site throw an exception when using ResponseCaching middleware. #189

Closed Bartmax closed 7 years ago

Bartmax commented 7 years ago

using the ResponseCachingMiddleware with VaryByQueryKeys

[ResponseCache(CacheProfileName = "DefaultCache", VaryByQueryKeys = new string[] { "id" })]

open chrome inspector tick disable cache go to page that uses a ResponseCache with VaryByQueryKeys

image

it throws: InvalidOperationException: 'VaryByQueryKeys' requires the response cache middleware.

closing the inspector or untick disable cache work fine.

Using fiddler, adding Pragma: no-cache header is enough to make the site throw an exception.

guardrex commented 7 years ago

Confirmed here.

capture

ctolkien commented 7 years ago

-

Bartmax commented 7 years ago

bad repo, mind comment again here: https://github.com/aspnet/ResponseCaching/issues/85