Allow AJAX GETs from Amazon S3? (Access-Control-Allow-Origin)

后端 未结 11 1802
灰色年华
灰色年华 2020-12-23 16:34

I\'m storing JSON objects in Amazon S3, and I\'d like to load that data directly from S3 from Javascript. My GET looks pretty generic:

$.ajax({
    \'type\':         


        
11条回答
  •  有刺的猬
    2020-12-23 17:30

    S3 doesn't send the 'Access-Control-Allow-Origin' header if you use the wildcard * like:

    *
    

    To force s3 sending the AllowedOrigin header but still let your content be loaded from any site, use this:

    http://*
    https://*
    

提交回复
热议问题