修复:OSS自定义域名拼接问题,无需配置HTTP等前缀

修复:OSS自定义域名拼接问题,无需配置HTTP、HTTPS等前缀
This commit is contained in:
JaneYork 2022-07-18 03:46:13 +00:00 committed by Gitee
parent b2a927cc5e
commit 5c9fe22780
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -119,12 +119,12 @@ public class OssClient {
}
public String getUrl() {
String header = OssConstant.IS_HTTPS.equals(properties.getIsHttps()) ? "https://" : "http://";
String domain = properties.getDomain();
if (StringUtils.isNotBlank(domain)) {
return domain;
return header + domain;
}
String endpoint = properties.getEndpoint();
String header = OssConstant.IS_HTTPS.equals(properties.getIsHttps()) ? "https://" : "http://";
// 云服务商直接返回
if (StringUtils.containsAny(endpoint, OssConstant.CLOUD_SERVICE)){
return header + properties.getBucketName() + "." + endpoint;