Checking for integrated pipeline before accessing http headers.

Otherwise breaks functional tests
This commit is contained in:
Sebastien Ros
2013-09-10 15:01:06 -07:00
parent f2552694c1
commit e019f4a09e

View File

@@ -453,8 +453,10 @@ namespace Orchard.OutputCache.Filters {
// an ETag is a string that uniquely identifies a specific version of a component.
// we use the cache item to detect if it's a new one
if (response.Headers.Get("ETag") == null) {
response.Cache.SetETag(cacheItem.GetHashCode().ToString(CultureInfo.InvariantCulture));
if (HttpRuntime.UsingIntegratedPipeline) {
if (response.Headers.Get("ETag") == null) {
response.Cache.SetETag(cacheItem.GetHashCode().ToString(CultureInfo.InvariantCulture));
}
}
response.Cache.SetOmitVaryStar(true);