FranGhe commented on issue #1840:
URL:
https://github.com/apache/cordova-android/issues/1840#issuecomment-3251156905
The problem has not been solved.
It worked for a few hours and the problem recurred.
Regarding CORS this is my php code and the server is the same for
development and production.
```
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
ini_set("safe_mode","Off");
ini_set("allow_url_fopen", "1");
date_default_timezone_set("Europe/Rome");
error_log("Bingo");
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) &&
strpos($_SERVER['HTTP_X_REQUESTED_WITH'], "gufy") !== false){
error_log("REQUEST FROM APP ANDROID -> ".$_REQUEST["FUNC"]);
//header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Origin: https://localhost');
}
else if(isset($_SERVER['HTTP_USER_AGENT']) &&
strpos($_SERVER['HTTP_USER_AGENT'], "gufy/") !== false){
error_log("REQUEST FROM APP APPLE -> ".$_REQUEST["HTTP_USER_AGENT"]." ->
".$_REQUEST["FUNC"]);
//header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Origin: https://localhost');
}
switch ($_REQUEST["FUNC"]) {
case 'test':
error_log("test");
die(true);
break;
default:
error_log("error");
die();
}
```
I currently use two Android devices.
The release version with <preference name="InspectableWebview" value="true"
/> is installed on the device1, the development version is installed on the
device2.
The code between production and development is the same.
Device1 fails to make the call to the server, while device2 succeeds.
On server side when I make the request from device2 I see “Bingo”, while
when I make the request from device1 my error_log is empty.
On the client side I inspected the two devices. On the left is device 1 and
on the right is device 2
<img width="1664" height="1009" alt="Image"
src="https://github.com/user-attachments/assets/ef8fc6d7-418a-4d6c-b9ce-e35303631732"
/>
I hope to resolve it...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]