curl -H "Access-Control-Request-Method: GET" -H "Origin: http://localhost" --head http://www.example.com/
Access-Control-Allow-*
then your resource supports CORS.Rationale for alternative answer
I google this question every now and then and the accepted answer is never what I need. First it prints response body which is a lot of text. Adding --head
outputs only headers. Second when testing S3 URLs we need to provide additional header -H "Access-Control-Request-Method: GET"
.
Hope this will save time.