mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 18:23:08 +02:00
空文字列のobjectStorageEndtpoinをnullと同様に扱う (#10312)
This commit is contained in:
parent
7e9d3d9b2f
commit
44213812b8
1 changed files with 5 additions and 3 deletions
|
@ -19,12 +19,14 @@ export class S3Service {
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public getS3(meta: Meta) {
|
public getS3(meta: Meta) {
|
||||||
const u = meta.objectStorageEndpoint != null
|
const u = meta.objectStorageEndpoint
|
||||||
? `${meta.objectStorageUseSSL ? 'https://' : 'http://'}${meta.objectStorageEndpoint}`
|
? `${meta.objectStorageUseSSL ? 'https://' : 'http://'}${meta.objectStorageEndpoint}`
|
||||||
: `${meta.objectStorageUseSSL ? 'https://' : 'http://'}example.net`;
|
: `${meta.objectStorageUseSSL ? 'https://' : 'http://'}example.net`;
|
||||||
|
|
||||||
return new S3({
|
return new S3({
|
||||||
endpoint: meta.objectStorageEndpoint ?? undefined,
|
endpoint: meta.objectStorageEndpoint && meta.objectStorageEndpoint.length > 0
|
||||||
|
? meta.objectStorageEndpoint
|
||||||
|
: undefined,
|
||||||
accessKeyId: meta.objectStorageAccessKey!,
|
accessKeyId: meta.objectStorageAccessKey!,
|
||||||
secretAccessKey: meta.objectStorageSecretKey!,
|
secretAccessKey: meta.objectStorageSecretKey!,
|
||||||
region: meta.objectStorageRegion ?? undefined,
|
region: meta.objectStorageRegion ?? undefined,
|
||||||
|
|
Loading…
Reference in a new issue