minio 使用域名时,forcePathStyle为true时,不增加二级域名,而是 xx.com/bucket的形式

This commit is contained in:
jackieZhouQQ 2023-11-21 17:20:03 +08:00 committed by GitHub
parent 619d7ca0af
commit 422760040c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -220,6 +220,8 @@ export interface AWSConfig {
expires?: number
/** publicDomain */
publicDomain?: string;
/** forcePathStyle */
forcePathStyle?: boolean;
}
/**

View File

@ -78,7 +78,7 @@ export class CoolFile {
this.client = new QINIU.auth.digest.Mac(accessKeyId, accessKeySecret);
}
if (aws) {
const { accessKeyId, secretAccessKey, region, publicDomain } = aws;
const { accessKeyId, secretAccessKey, region, publicDomain, forcePathStyle } = aws;
this.client = new S3Client({
region,
credentials: { accessKeyId, secretAccessKey },
@ -86,6 +86,8 @@ export class CoolFile {
endpoint: publicDomain
? publicDomain
: `https://s3.${region}.amazonaws.com`,
// minio 使用域名时forcePathStyle为true时不增加二级域名而是 xx.com/bucket的形式
forcePathStyle: forcePathStyle ? forcePathStyle : false,
});
}
}

View File

@ -108,6 +108,8 @@ export interface AWSConfig {
expires?: number;
/** publicDomain */
publicDomain?: string;
/** forcePathStyle */
forcePathStyle?: boolean;
}
export interface QINIUConfig {