javascript - Amazon S3 getObject Bucket Policy -
i have policy declared on bucket:
{ "sid": "policy 1", "effect": "allow", "principal": "*", "action": [ "s3:deleteobject", "s3:getobject", "s3:putobject" ], "resource": "arn:aws:s3:::<bucket_name>/*", "condition": { "stringlike": { "aws:referer": "http://example.com/*" } } }
i declared condition aws:referer because want objects accessed domain only. node api, add s3 object attachment internal download.
this.response.attachment(key) this.body = request(location, { encoding: null })
however, produce "unhandled rejection statuscodeerror: 403". file can uploaded s3 bucket , can object already. problem part download. tried removing condition in policy , download works fine. may problem bucket policy?
Comments
Post a Comment