Esempio n. 1
0
        public void ProcessRequest(HttpContext context)
        {
            DoSecurityChecks(context);

            // ToDo - more on MimeTypes?
            if (context.Request.FilePath.EndsWith(".xml"))
            {
                // ToDo - if we are specifying XML, shouldn't we throw valid XML exceptions?
                context.Response.ContentType = "Text/XML";
            }

            ObjectGiver objectGiver = new CruiseObjectGiverInitializer(new ManagableObjectGiver()).SetupObjectGiverForRequest(context);
            IResponse response = ((RequestController) objectGiver.GiveObjectByType(typeof(RequestController))).Do();

            if (response is RedirectResponse)
            {
                context.Response.Redirect(((RedirectResponse) response).Url);
            }
            else
            {
                context.Response.Write(((HtmlFragmentResponse) response).ResponseFragment);
            }

            context.Response.Flush();
        }
Esempio n. 2
0
        public void ProcessRequest(HttpContext context)
        {
            DoSecurityChecks(context);

            // ToDo - more on MimeTypes?
            if (context.Request.FilePath.EndsWith(".xml"))
            {
                // ToDo - if we are specifying XML, shouldn't we throw valid XML exceptions?
                context.Response.ContentType = "Text/XML";
            }

            ObjectGiver objectGiver = new CruiseObjectGiverInitializer(new ManagableObjectGiver()).SetupObjectGiverForRequest(context);
            IResponse   response    = ((RequestController)objectGiver.GiveObjectByType(typeof(RequestController))).Do();

            if (response is RedirectResponse)
            {
                context.Response.Redirect(((RedirectResponse)response).Url);
            }
            else
            {
                context.Response.Write(((HtmlFragmentResponse)response).ResponseFragment);
            }

            context.Response.Flush();
        }