SkygearIO / py-skygear

Skygear Cloud Code Python SDK
https://skygear.io
Other
8 stars 20 forks source link

S3 signer generates incorrect url for region us-east-1 #191

Open louischan-oursky opened 6 years ago

louischan-oursky commented 6 years ago

Expected Results

The generated URL should always be valid.

https://s3.amazonaws.com/<bucket>/<object-name>

Actual Results

https://s3-us-east-1.amazonaws.com/<bucket>/<object-name>

Steps to reproduce

  1. Use a S3 bucket located in region us-east-1
  2. ASSET_STORE_PUBLIC=YES
  3. skygear.asset.get_signer().sign(some_asset_id)

Cause

When ASSET_STORE_PUBLIC=YES, we naively concat the region to build the URL. The valid format is documented here

Workaround

Use ASSET_STORE_S3_URL_PREFIX=https://s3.amazonaws.com/<bucket>