Ionic signalr cors issue

#1

I allowed cors in my asp.net signalr project. Signalr client connected. But another controller action for join signalr group, handle cors error

please help me !

Globalasax
protected void Application_BeginRequest(object sender, EventArgs e)
{
var response = Context.Response;
Context.Response.AppendHeader(“Access-Control-Allow-Credentials”, “true”);
var referrer = Request.UrlReferrer;
if ((Context.Request.Path.Contains(“localhost:”) ||Context.Request.Path.Contains(“signalr/”)|| Context.Request.Path.Contains(“negotiate”)) && referrer != null)
{
Context.Response.AppendHeader(“Access-Control-Allow-Origin”, “");
// Context.Response.AppendHeader(“Access-Control-Allow-Origin”, referrer.Scheme + “://” + referrer.Authority);
if (Context.Request.HttpMethod == “OPTIONS”)
{
response.AddHeader(“Access-Control-Allow-Methods”, “GET, POST”);
response.AddHeader(“Access-Control-Allow-Headers”, “Content-Type, Accept”);
response.AddHeader(“Access-Control-Max-Age”, “1728000”);
response.End();
}
}
else
Context.Response.AppendHeader(“Access-Control-Allow-Origin”,"
”);

    } 

ERROR :
Access to XMLHttpRequest at ‘https://xxx.xxx.com/SignalRProject/default/JoinGroup’ from origin ‘http://localhost:8100’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.