public bool TryFindContent(PublishedRequest request)
        {
            //Check the table
            var matchedRedirect = _repository.FindRedirect(request.Uri);

            if (matchedRedirect == null)
            {
                return(false);
            }

            request.SetRedirect(matchedRedirect.GetNewUrl(request.Uri), matchedRedirect.RedirectCode);

            return(true);
        }
Esempio n. 2
0
        public bool TryFindContent(PublishedRequest request)
        {
            var status = _allowedIpService.GetStatus();

            if (!status.Enabled)
            {
                return(false);
            }

            var ip   = request.UmbracoContext.HttpContext.Request.UserHostAddress;
            var item = _allowedIpService.GetByIpAddress(ip);

            if (item == null)
            {
                request.SetRedirect("/ip-not-allowed");

                return(true);
            }

            return(false);
        }