public async Task<TestModel> ExecuteactionOnAllServers(TestModel model)
{
//few lines of code
tasks.Add(ExecuteactionOnmachine(system.web.HttpContext.Current,model,"http://localhost:2035/Gen/intranet/Test/ExecuteactionLocally","localhost"));
}
private async Task<string> ExecuteactionOnmachine(system.web.HttpContext ctx,TestModel model,string url,string machineName)
{
string response = null;
await Task.Run(() =>
{
try
{
//few lines of code
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(PageModel));
HttpWebRequest requestHttp = (HttpWebRequest)WebRequest.Create(url);
requestHttp.Method = "POST";
requestHttp.ContentType = "application/json;";
ser.WriteObject(requestHttp.GetRequestStream(),model);
//few lines of code
}
Catch()
{
}
}
}
TestController.cs中的Invoke()方法将未经验证的数据发送到Web浏览器。 在这种情况下,数据将输入TestController.cs中的ExecuteactionOnAllServers() 数据包含在未经验证的动态内容中,该内容将发送给Web用户。在这种情况下,数据将通过TestController.cs中的WriteObject()发送。
如何处理跨站点脚本:反映在上述情况下?