fix: S3Storage incorrectly setting hostname
This commit is contained in:
@@ -199,10 +199,7 @@ export default class S3Storage extends BaseStorage {
|
|||||||
|
|
||||||
// support old path-style S3 uploads and new virtual host uploads by
|
// support old path-style S3 uploads and new virtual host uploads by
|
||||||
// checking for the bucket name in the endpoint url.
|
// checking for the bucket name in the endpoint url.
|
||||||
if (
|
if (env.AWS_S3_UPLOAD_BUCKET_NAME) {
|
||||||
env.AWS_S3_UPLOAD_BUCKET_NAME &&
|
|
||||||
env.AWS_S3_FORCE_PATH_STYLE === false
|
|
||||||
) {
|
|
||||||
const url = new URL(env.AWS_S3_UPLOAD_BUCKET_URL);
|
const url = new URL(env.AWS_S3_UPLOAD_BUCKET_URL);
|
||||||
if (url.hostname.startsWith(env.AWS_S3_UPLOAD_BUCKET_NAME + ".")) {
|
if (url.hostname.startsWith(env.AWS_S3_UPLOAD_BUCKET_NAME + ".")) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user