diff --git a/docs/en/framework/infrastructure/blob-storing/aws.md b/docs/en/framework/infrastructure/blob-storing/aws.md index b419521bed..1ee55bbb74 100644 --- a/docs/en/framework/infrastructure/blob-storing/aws.md +++ b/docs/en/framework/infrastructure/blob-storing/aws.md @@ -41,7 +41,7 @@ Configure(options => Aws.UseTemporaryFederatedCredentials = "set true to use temporary federated credentials"; Aws.ProfileName = "the name of the profile to get credentials from"; Aws.ProfilesLocation = "the path to the aws credentials file to look at"; - Aws.Region = "the system name of the service"; + Aws.Region = "the AWS region system name, e.g. us-east-1"; Aws.ServiceURL = "custom service URL for S3-compatible APIs (optional)"; Aws.Name = "the name of the federated user"; Aws.Policy = "policy"; diff --git a/framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/AwsBlobProviderConfiguration.cs b/framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/AwsBlobProviderConfiguration.cs index fff08dc42b..fa318bdcb8 100644 --- a/framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/AwsBlobProviderConfiguration.cs +++ b/framework/src/Volo.Abp.BlobStoring.Aws/Volo/Abp/BlobStoring/Aws/AwsBlobProviderConfiguration.cs @@ -64,7 +64,15 @@ public class AwsBlobProviderConfiguration /// public string? Region { get => _containerConfiguration.GetConfigurationOrDefault(AwsBlobProviderConfigurationNames.Region); - set => _containerConfiguration.SetConfiguration(AwsBlobProviderConfigurationNames.Region, value); + set + { + if (value == null) + { + _containerConfiguration.ClearConfiguration(AwsBlobProviderConfigurationNames.Region); + return; + } + _containerConfiguration.SetConfiguration(AwsBlobProviderConfigurationNames.Region, value); + } } /// @@ -74,7 +82,15 @@ public class AwsBlobProviderConfiguration /// public string? ServiceURL { get => _containerConfiguration.GetConfigurationOrDefault(AwsBlobProviderConfigurationNames.ServiceURL); - set => _containerConfiguration.SetConfiguration(AwsBlobProviderConfigurationNames.ServiceURL, value); + set + { + if (value == null) + { + _containerConfiguration.ClearConfiguration(AwsBlobProviderConfigurationNames.ServiceURL); + return; + } + _containerConfiguration.SetConfiguration(AwsBlobProviderConfigurationNames.ServiceURL, value); + } } /// diff --git a/framework/test/Volo.Abp.BlobStoring.Aws.Tests/Volo/Abp/BlobStoring/Aws/AbpBlobStoringAwsTestModule.cs b/framework/test/Volo.Abp.BlobStoring.Aws.Tests/Volo/Abp/BlobStoring/Aws/AbpBlobStoringAwsTestModule.cs index 8ef4000e61..bd7b07c40c 100644 --- a/framework/test/Volo.Abp.BlobStoring.Aws.Tests/Volo/Abp/BlobStoring/Aws/AbpBlobStoringAwsTestModule.cs +++ b/framework/test/Volo.Abp.BlobStoring.Aws.Tests/Volo/Abp/BlobStoring/Aws/AbpBlobStoringAwsTestModule.cs @@ -139,9 +139,9 @@ public class AbpBlobStoringAwsTestModule : AbpModule } } - private async Task DeleteObjectsAsync(AmazonS3Client client, string prefix) + private async Task DeleteObjectsAsync(AmazonS3Client client, string? prefix) { - string continuationToken = null; + string? continuationToken = null; do { var listResponse = await client.ListObjectsV2Async(new ListObjectsV2Request