Exemple #1
0
 public void ProcessRequest(string path)
 {
     httpContext.DisableHtmlRewriting();
     using (bundles.GetReadLock())
     {
         var bundle = FindBundle(path);
         if (bundle == null)
         {
             Trace.Source.TraceInformation("Bundle not found \"{0}\".", path);
             response.StatusCode = 404;
         }
         else
         {
             var actualETag = "\"" + bundle.Hash.ToHexString() + "\"";
             var givenETag  = request.Headers["If-None-Match"];
             if (givenETag == actualETag)
             {
                 SendNotModified(actualETag);
             }
             else
             {
                 SendBundle(bundle, actualETag);
             }
         }
     }
 }
        public void ProcessRequest()
        {
            httpContext.DisableHtmlRewriting();
            var bundle = FindBundle();

            if (bundle == null)
            {
                Trace.Source.TraceInformation("Bundle not found \"{0}\".", Path.Combine("~", routeData.GetRequiredString("path")));
                response.StatusCode = 404;
            }
            else
            {
                var actualETag = "\"" + bundle.Hash.ToHexString() + "\"";
                var givenETag  = request.Headers["If-None-Match"];
                if (givenETag == actualETag)
                {
                    SendNotModified(actualETag);
                }
                else
                {
                    SendBundle(bundle, actualETag);
                }
            }
        }
 public void WhenDisableHtmlRewriting_ThenCassetteIsHtmlRewritingEnabledAddedToContextItems()
 {
     context.DisableHtmlRewriting();
     items.ContainsKey("Cassette.IsHtmlRewritingEnabled").ShouldBeTrue();
 }