zoomoid / strapi-provider-upload-aws-s3-advanced

A partial fork of https://github.com/strapi/strapi to extend the S3 Upload Provider to support path prefixes inside a bucket
MIT License
26 stars 23 forks source link

Cannot set baseUrl to an empty string. #9

Closed mjoynes-14four closed 2 years ago

mjoynes-14four commented 2 years ago

Describe the bug You cannot set the baseUrl to an empty string. It will prepend the S3 url.

To Reproduce Steps to reproduce the behavior:

  1. Try to set the baseUrl to an empty string.
  2. Upload and image.
  3. View URL for image.

Expected behavior If you provide an empty string to the base URL it should not prepend anything to the url in the database.

Additional context

https://github.com/zoomoid/strapi-provider-upload-aws-s3-advanced/blob/main/lib/index.js#L38 If you change this line to if (config.baseUrl || config.baseUrl === "") { then it will allow you to use an empty string to prevent it from prepending the S3 url.