Ejemplo n.º 1
0
        public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, string operationName)
        {
            if (MarkdownFormat == null)
            {
                MarkdownFormat = MarkdownFormat.Instance;
            }

            var contentPage = MarkdownPage ?? MarkdownFormat.FindByPathInfo(PathInfo);

            if (contentPage == null)
            {
                httpRes.StatusCode = (int)HttpStatusCode.NotFound;
                httpRes.EndHttpHandlerRequest();
                return;
            }

            MarkdownFormat.ReloadModifiedPageAndTemplates(contentPage);

            if (httpReq.DidReturn304NotModified(contentPage.GetLastModified(), httpRes))
            {
                return;
            }

            var model = Model;

            if (model == null)
            {
                httpReq.Items.TryGetValue("Model", out model);
            }

            MarkdownFormat.ProcessMarkdownPage(httpReq, contentPage, model, httpRes);
        }
Ejemplo n.º 2
0
        public override void ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, string operationName)
        {
            var contentPage = MarkdownPage;

            if (contentPage == null)
            {
                var pageFilePath = this.FilePath.WithoutExtension();
                contentPage = MarkdownFormat.GetContentPage(pageFilePath);
            }
            if (contentPage == null)
            {
                httpRes.StatusCode = (int)HttpStatusCode.NotFound;
                return;
            }

            MarkdownFormat.ReloadModifiedPageAndTemplates(contentPage);

            if (httpReq.DidReturn304NotModified(contentPage.GetLastModified(), httpRes))
            {
                return;
            }

            MarkdownFormat.ProcessMarkdownPage(httpReq, contentPage, null, httpRes);
        }