Skip to content

Commit

Permalink
S3ならばs3ForcePathStyleしない
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Mar 9, 2020
1 parent 49e9e48 commit 2c5f138
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/services/drive/add-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ async function upload(key: string, stream: fs.ReadStream | Buffer, type: string,

const upload = s3.upload(params);

await upload.promise();
const result = await upload.promise();
if (result) logger.debug(`Uploaded: ${result.Bucket}/${result.Key} => ${result.Location}`);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/services/drive/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function getS3(drive: DriveConfig) {
secretAccessKey: drive.config.secretKey,
region: drive.config.region || undefined,
sslEnabled: drive.config.useSSL,
s3ForcePathStyle: true,
s3ForcePathStyle: !!drive.config.endPoint,
httpOptions: {
}
} as S3.ClientConfiguration;
Expand Down

0 comments on commit 2c5f138

Please sign in to comment.