我收到一条错误消息:“安全错误。” 调用以下代码时:
_hubConnection.Start(new LongPollingTransport()).ContinueWith(task =>
{
if (task.IsFaulted)
{
throw new Exception(task.Exception.GetBaseException().Message);
}
}
堆栈跟踪:
在 System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) 在 Microsoft.AspNet.SignalR.Client.Http.HttpHelper.<>c_ DisplayClass2.b _0(IAsyncResult ar) 在 System.Threading.Tasks.TaskFactory 1.FromAsyncCoreLogic(IAsyncResult iar, Func
2 endFunction, Action 1 endAction, Task
1个承诺)
跨域 XML:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-http-request-headers-from domain="*" headers="SOAPAction,Content-Type"/>
</cross-domain-policy>
客户端访问策略:
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-methods="*" http-request-headers="*">
<domain uri="http://*"/>
<domain uri="https://*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
还尝试提供凭据,但结果相同。
知道什么可能导致这个问题吗?