I recently ran into the problem of requesting CORS (Cross Origin Resource Sharing) on Safari, both OSX and iOS, while the same request works fine on Chrome and Firefox. I follow the W3C documentation and process the server-side preflight request, my answer is similar:
HTTP/1.0 200 OK
Access-Control-Allow-Origin: http://192.168.1.96:4399
Access-Control-Allow-Methods: POST
Access-Control-Allow-Methods: GET
Access-Control-Allow-Methods: OPTIONS
Access-Control-Allow-Headers: Origin
Access-Control-Allow-Headers: Authorization
Access-Control-Allow-Headers: X-Requested-With
Access-Control-Allow-Headers: Accept
Access-Control-Allow-Headers: Access-Control-Request-Method
Access-Control-Allow-Headers: Access-Control-Request-Headers
Access-Control-Allow-Headers: DNT
Access-Control-Allow-Headers: X-CustomHeader
Access-Control-Allow-Headers: Content-Type
Access-Control-Max-Age: 0
Date: Fri, 25 Nov 2016 08:45:25 GMT
Origin: http://192.168.1.96:4399
Access-Control-Expose-Headers: Origin
Content-Encoding: gzip
Transfer-Encoding: chunked
This response works fine in Chrome, Firefox, and Android: a POST request is sent immediately after a preliminary check request. But in Safari, after the server responded to the highlight request, I received an error message from the console:
Failed to load resource: The network connection was lost.
, , ... :-(
-, ? - , ?
!