Exemple #1
0
        override public void Process(WebContext <TSiteData, TSession> context)
        {
            byte[] content = GetContent();
            context.Response.SetStdHeaders(context.Request.KeepAlive, ContentTypes.XHTML, content.Length);
            IBodyWriter bodyWriter = new BytesBodyWriter(content);

            bodyWriter.WriteBody(context.Response, context.WebServerUtilities);
        }
 override public void Process(WebContext <TSiteData, TSession> context)
 {
     try
     {
         string uriPath = context.WebSiteInfo.MapPath(context.Request.AbsoluteUriPath);
         byte[] content = System.IO.File.ReadAllBytes(uriPath);
         context.Response.SetStdHeaders(context.Request.KeepAlive, _ContentType, content.Length);
         IBodyWriter bodyWriter = new BytesBodyWriter(content);
         bodyWriter.WriteBody(context.Response, context.WebServerUtilities);
     }
     catch (System.IO.FileNotFoundException)
     {
         throw new WebExceptions.ResourceNotFound(context.Request.RequestURI);
     }
 }