davybrion / Agatha

Agatha Request-Response Service Layer for .NET
http://davybrion.github.com/Agatha/
Other
86 stars 39 forks source link

Support for subtyping of BusinessException and SecurityException #31

Closed jochenvangasse closed 4 years ago

jochenvangasse commented 11 years ago

Added support for subtyping of BusinessException and SecurityException in RequestProcessingHandler.

lilan123 commented 9 years ago

Enable Cors this will be enabled cors in agatha request response service to work.

Go to Global.asax.cs

protected void Application_BeginRequest(object sender, EventArgs e) { var context = HttpContext.Current; var response = context.Response;

        // enable CORS
        //response.AddHeader("Access-Control-Allow-Origin", "*");
        response.AddHeader("Access-Control-Allow-Origin", "*");
        response.AddHeader("X-Frame-Options", "ALLOW-FROM *");

        if (context.Request.HttpMethod == "OPTIONS")
        {
            response.AddHeader("Access-Control-Request-Method", "POST,GET,PUT,DELETE,OPTIONS");
            response.AddHeader("Access-Control-Allow-Headers", "Accept");
            response.AddHeader("Access-Control-Allow-Headers", "Authorization,Origin,X-Requested-With,Content-Type");
            response.AddHeader("Access-Control-Max-Age", "1728000");
            response.End();
        }
    }