I've run a couple of tests and found that by modifying HttpContext.Current.User
Application_PostAuthenticateRequest
(Global.asax.cs) I get an Internal Server Error in the concatenated / mined bundle request.
Follow the code quoted:
protected void Application_PostAuthenticateRequest( Object sender, EventArgs e )
{
HttpContext.Current.User = SessionManager.GetCurrentUser( Request );
if (IsWebApiRequest())
{
HttpContext.Current.SetSessionStateBehavior( SessionStateBehavior.Required );
}
}
private bool IsWebApiRequest()
{
return HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath.StartsWith( WebApiConfig.UrlPrefixRelative );
}