mirror of
https://github.com/remotely-save/remotely-save.git
synced 2024-06-07 21:10:45 +00:00
fix endpoint
This commit is contained in:
parent
59645e620a
commit
714807cdc7
@ -45,9 +45,13 @@ export const DEFAULT_S3_CONFIG = {
|
|||||||
export type S3ObjectType = _Object;
|
export type S3ObjectType = _Object;
|
||||||
|
|
||||||
export const getS3Client = (s3Config: S3Config) => {
|
export const getS3Client = (s3Config: S3Config) => {
|
||||||
|
let endpoint = s3Config.s3Endpoint;
|
||||||
|
if (!(endpoint.startsWith("http://") || endpoint.startsWith("https://"))) {
|
||||||
|
endpoint = `https://${endpoint}`;
|
||||||
|
}
|
||||||
const s3Client = new S3Client({
|
const s3Client = new S3Client({
|
||||||
region: s3Config.s3Region,
|
region: s3Config.s3Region,
|
||||||
endpoint: s3Config.s3Endpoint,
|
endpoint: endpoint,
|
||||||
credentials: {
|
credentials: {
|
||||||
accessKeyId: s3Config.s3AccessKeyID,
|
accessKeyId: s3Config.s3AccessKeyID,
|
||||||
secretAccessKey: s3Config.s3SecretAccessKey,
|
secretAccessKey: s3Config.s3SecretAccessKey,
|
||||||
|
Loading…
Reference in New Issue
Block a user