fix: S3Storage incorrectly setting hostname

This commit is contained in:
Tom Moor
2023-08-31 20:44:34 -04:00
parent 911bb1f492
commit 8b4b2ca741

View File

@@ -199,10 +199,7 @@ export default class S3Storage extends BaseStorage {
// support old path-style S3 uploads and new virtual host uploads by
// checking for the bucket name in the endpoint url.
if (
env.AWS_S3_UPLOAD_BUCKET_NAME &&
env.AWS_S3_FORCE_PATH_STYLE === false
) {
if (env.AWS_S3_UPLOAD_BUCKET_NAME) {
const url = new URL(env.AWS_S3_UPLOAD_BUCKET_URL);
if (url.hostname.startsWith(env.AWS_S3_UPLOAD_BUCKET_NAME + ".")) {
return undefined;