CORS request header parameters not sending in Chrome
<p>I try to use swagger ui for rest api documentation. Rest API created with WCF service. I solved cors issue, service accepts OPTIONS method. But request has a header parameter which name is SessionUUID, this parameter doesn't send to service. When i debug the service side, this parameter does not come. This problem is only in Chrome. <strong>Chrome blocks to header params in cors request.</strong></p>

<p>Cors problem's solving on WCF Service like this;</p>

<ol>
<li><p>I added new behavior and header params are defined</p>

<pre><code>public class EnableCorsEndpointBehavior : BehaviorExtensionElement, IEndpointBehavior
{
   ...

    public void ApplyDispatchBehavior(ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.EndpointDispatcher endpointDispatcher)
    {
        var requiredHeaders = new Dictionary&lt;string, string&gt;();

        requiredHeaders.Add("Access-Control-Allow-Origin", "*");
        requiredHeaders.Add("Access-Control-Request-Method", "POST,GET,PUT,DELETE,OPTIONS");
        requiredHeaders.Add("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, Accept, Accept-Language, SessionUUID, Origin, X-Custom-Header, sessionuuid");
        requiredHeaders.Add("Access-Control-Allow-Credentials", "true");
        endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new ServiceInspector(requiredHeaders));
    }    
   ...
  }
</code></pre>

<ol start="2">
<li><p>I added response headers in inspector. Header parameter which named as SessionUUID is checked in AfterReceiveRequest but it is <strong>null</strong>, because of this problem. </p>

<pre><code>public object AfterReceiveRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel, System.ServiceModel.InstanceContext instanceContext)
{
    try
    {


        WebHeaderCollection headers = WebOperationContext.Current.IncomingRequest.Headers;
        string requestTo = request.Headers.To.ToString();


        if (!requestTo.Contains("login") &amp;&amp; request.GetType().Name != "InternalByteStreamMessage")
        {
            if (headers["SessionUUID"] == null)
            {
                throw new RestAppException("401", "Oturum bilgisi bulunamadı.");
            }
            else
            {
                DateTime requestDate = DateTime.Now;
                string sessionUUID = headers["SessionUUID"] != null ? headers["SessionUUID"].AsString() : headers["sessionuuid"].AsString();
                sessionManager.CheckSessionByUUID(sessionUUID, requestDate);

                sessionManager.UpdateExpireDate(sessionUUID, requestDate);
                sessionManager.SetSessionByUUID(sessionUUID);
            }
        }
    }
    catch (RestAppException ex)
    {
        ex.Message = "İşlem Başarısız";
        throw ex;
    }
    catch (Exception ex)
    {
        throw ex;
    }

    return null;
}

public void BeforeSendReply(ref System.ServiceModel.Channels.Message reply, object correlationState)
{
    var httpHeader = reply.Properties["httpResponse"] as HttpResponseMessageProperty;
    foreach (var item in requiredHeaders)
    {
        httpHeader.Headers.Add(item.Key, item.Value);
    }
}
</code></pre></li>
</ol></li>
</ol>

<p>How can i solve this chrome issue? </p>