@@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Web.Caching.AWS;
16
16
public class AWSS3StorageCache : IImageCache
17
17
{
18
18
private readonly IAmazonS3 amazonS3Client ;
19
- private readonly string bucket ;
19
+ private readonly string bucketName ;
20
20
21
21
/// <summary>
22
22
/// Initializes a new instance of the <see cref="AWSS3StorageCache"/> class.
@@ -26,19 +26,19 @@ public AWSS3StorageCache(IOptions<AWSS3StorageCacheOptions> cacheOptions)
26
26
{
27
27
Guard . NotNull ( cacheOptions , nameof ( cacheOptions ) ) ;
28
28
AWSS3StorageCacheOptions options = cacheOptions . Value ;
29
- this . bucket = options . BucketName ;
29
+ this . bucketName = options . BucketName ;
30
30
this . amazonS3Client = AmazonS3ClientFactory . CreateClient ( options ) ;
31
31
}
32
32
33
33
/// <inheritdoc/>
34
34
public async Task < IImageCacheResolver ? > GetAsync ( string key )
35
35
{
36
- GetObjectMetadataRequest request = new ( ) { BucketName = this . bucket , Key = key } ;
36
+ GetObjectMetadataRequest request = new ( ) { BucketName = this . bucketName , Key = key } ;
37
37
try
38
38
{
39
39
// HEAD request throws a 404 if not found.
40
40
MetadataCollection metadata = ( await this . amazonS3Client . GetObjectMetadataAsync ( request ) ) . Metadata ;
41
- return new AWSS3StorageCacheResolver ( this . amazonS3Client , this . bucket ! , key , metadata ) ;
41
+ return new AWSS3StorageCacheResolver ( this . amazonS3Client , this . bucketName , key , metadata ) ;
42
42
}
43
43
catch
44
44
{
@@ -51,7 +51,7 @@ public Task SetAsync(string key, Stream stream, ImageCacheMetadata metadata)
51
51
{
52
52
PutObjectRequest request = new ( )
53
53
{
54
- BucketName = this . bucket ,
54
+ BucketName = this . bucketName ,
55
55
Key = key ,
56
56
ContentType = metadata . ContentType ,
57
57
InputStream = stream ,
0 commit comments