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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot set baseUrl to an empty string.

mjoynes-14four opened this issue · comments

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.