Alejandro created CB-14124:
------------------------------
Summary: Access-Control-Allow-Headers
Key: CB-14124
URL: https://issues.apache.org/jira/browse/CB-14124
Project: Apache Cordova
Issue Type: Bug
Components: cordova-ios, cordova-plugin-wkwebview-engine
Affects Versions: [email protected], 8.0.0
Reporter: Alejandro
Assignee: Suraj Pindoria
Hello,
I have one app with:
Cordova version: 8.0.0
cordova-ios version: 4.5.4
I had to install the plugin
"[cordova-plugin-wkwebview-engine|https://github.com/apache/cordova-plugin-wkwebview-engine]"
to solve a problem with the interface.
In android everything works correctly.
But in IOS when I make AJAX requests to my API I have the error:
XMLHttpRequest cannot load ....... Request header field Authorization is not
allowed by Access-Control-Allow-Headers
In the API I have the following in place to allow CORS connections:
{code:java}
header('Access-Control-Allow-Headers: *');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: *');
{code}
In the config.xml I have this:
{code:java}
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />{code}
and my AJAX requests are:
{code:java}
$.ajax({
url: url,
data: formData,
type: 'post',
dataType: "json",
contentType: false,
processData: false,
success: function (respuesta) {
}
});
{code}
And I have this meta:
{code:java}
<meta http-equiv="Content-Security-Policy" content="default-src * gap:;font-src
'self' data:; style-src * 'unsafe-inline'; script-src * 'unsafe-inline'
'unsafe-eval'; media-src *; img-src * filesystem: data:">
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]