I’m doing an app with ionic for android and ios, on android works fine, but on ios I have this problem:
The app is working with wordpress as backend, and I am using REST API, and JSON API, I need both because of some modifications in the wordpress (Not done by me) which make that some parts are more accesible with REST API an some WITH JSON API.
I have this two urls:
And also I have made some requests directly with PHP like this
The first one works nice, the second one give me error.
I thought that it was a CORS problem, after inspect the headers, I could see that where different, this are the headers:
date: Wed, 20 Dec 2017 17:07:46 GMT
server: Apache
x-robots-tag: noindex
x-content-type-options: nosniff
access-control-expose-headers:X-WP-Total, X-WP-TotalPages
access-control-allow-headers: Authorization, Content-Type
x-wp-total:286
x-wp-totalpages:29
link:https://www.xxxx.com/wp-json/wp/v2/saborear?page=2; rel=“next”
allow:GET
transfer-encoding:chunked
content-type:application/json; charset=UTF-8
date:Wed, 20 Dec 2017 17:08:52 GMT
server:Apache
x-pingback:https://www.xxxx.com/xmlrpc.php
transfer-encoding:chunked
content-type:application/json; charset=UTF-8
date:Wed, 20 Dec 2017 17:09:27 GMT
server:Apache
access-control-allow-origin:*
transfer-encoding:chunked
content-type:application/json
So I changed my htaccess with:
Header set Access-Control-Allow-Origin “*”
This make that 1 and 3 stop working and 2 works.
And the headers now have this line:
access-control-allow-origin: * ; *
Any solution?
Thanks in advance.