FranGhe commented on issue #1299:
URL: https://github.com/apache/cordova-ios/issues/1299#issuecomment-1477385173

   > I know for certain that iOS 10 and earlier didn't properly support 
wildcards, and based on what you're telling me that might still be the case 
with current iOS versions. If that's the situation then the proper solution 
would be to return the domain as read from the `Origin` request header, which 
would simulate a wildcard behaviour.
   
   Like this?:
   
   ```
   if (isset($_SERVER['HTTP_ORIGIN'])) {
       header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
       header('Access-Control-Allow-Credentials: true');
       header('Access-Control-Max-Age: 86400');    // cache for 1 day
   }
   
   if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
       if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])){
           header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, 
OPTIONS");
       }         
       if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])){
           header("Access-Control-Allow-Headers: 
{$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");
       }
   }
   ```
   


-- 
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]

Reply via email to