public void Process(HttpContextBase httpContext)
        {
            var requestUri = httpContext.Request.Url;
            if (requestUri == null) return;

            if (Configuration.IgnoreUrlPrefixes.Length > 0 &&
                Configuration.IgnoreUrlPrefixes.Any(
                    prefix => requestUri.PathAndQuery.StartsWith(prefix, StringComparison.InvariantCultureIgnoreCase)))
            {
                return;
            }

            var siteContext = Context.Site;
            if (siteContext == null) return;

            var db = siteContext.Database;
            if (db == null) return;

            var outboundRules = GetOutboundRules(db);
            var rewriter = new OutboundRewriter();

            // check preconditions

            var transformer = new Tranformer(httpContext, rewriter, outboundRules);
            transformer.SetupResponseFilter();
        }
Exemple #2
0
        public void Process(HttpContextBase httpContext)
        {
            var requestUri = httpContext.Request.Url;

            if (requestUri == null)
            {
                return;
            }

            if (Configuration.IgnoreUrlPrefixes.Length > 0 &&
                Configuration.IgnoreUrlPrefixes.Any(
                    prefix => requestUri.PathAndQuery.StartsWith(prefix, StringComparison.InvariantCultureIgnoreCase)))
            {
                return;
            }

            var siteContext = Context.Site;

            if (siteContext == null)
            {
                return;
            }

            var db = siteContext.Database;

            if (db == null)
            {
                return;
            }

            var outboundRules = GetOutboundRules(db);
            var rewriter      = new OutboundRewriter();

            // check preconditions

            var transformer = new Tranformer(httpContext, rewriter, outboundRules);

            transformer.SetupResponseFilter();
        }
 public Tranformer(HttpContextBase httpContext, OutboundRewriter rewriter, List<OutboundRule> outboundRules)
 {
     _outboundRules = outboundRules;
     _httpContext = httpContext;
     _rewriter = rewriter;
 }
Exemple #4
0
 public Tranformer(HttpContextBase httpContext, OutboundRewriter rewriter, List <OutboundRule> outboundRules)
 {
     _outboundRules = outboundRules;
     _httpContext   = httpContext;
     _rewriter      = rewriter;
 }