Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response

I have a Elasticsearch cluster running on Centos 6 with Java. Whenever I am trying to run a query from my client side made with AngularJs I get the following error,

Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response

I have put the following code in my config/elasticsearch.yml file.

http.cors.enabled : true
http.cors.allow-origin : "*"
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type, Content-Length
http.cors.allow-credentials : true

What am I doing wrong? Thanks in advance.

What version are you on?

{ "name": "Isaac Christians", "cluster_name": "elasticsearch", "version": { "number": "2.3.1", "build_hash": "bd980929010aef404e7cb0843e61d0665269fc39", "build_timestamp": "2016-04-04T12:25:05Z", "build_snapshot": false, "lucene_version": "5.5.0" }, "tagline": "You Know, for Search" }