public void Process(GenerateSitemapArgs args)
 {
     if (string.IsNullOrWhiteSpace(args.CacheKeyBase))
     {
         args.AbortPipeline();
     }
 }
Exemplo n.º 2
0
        public void ParsesIndexRequestIntoBaseCacheKey()
        {
            var url  = "http://test.com/sitemap_index.xml";
            var args = new GenerateSitemapArgs()
            {
                RequestUrl = url
            };

            new GetCacheKey().Process(args);

            args.CacheKeyBase.Should().Be("http://test.com/sitemap.xml");
        }
        public void ProcessRequest(HttpContext context)
        {
            var args = new GenerateSitemapArgs()
            {
                RequestUrl = context.Request.RawUrl
            };

            CorePipeline.Run("getSitemapXml", args);

            if (string.IsNullOrWhiteSpace(args.Content))
            {
                return;
            }

            context.Response.ContentType = "application/xml";
            context.Response.Write(args.Content);
            context.Response.End();
        }