Skip to content

Commit ebc4227

Browse files
dudchenko610Ruslan Dudchenko
and
Ruslan Dudchenko
authored
Aws fix (#20)
* changed upload method * fixed AWS get method * changed version to 1.0.0 Co-authored-by: Ruslan Dudchenko <[email protected]>
1 parent 179c6fa commit ebc4227

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

Directory.Build.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1414
<PackageReadmeFile>README.md</PackageReadmeFile>
1515
<Product>Managed Code - Storage</Product>
16-
<Version>0.1.0</Version>
17-
<PackageVersion>0.1.0</PackageVersion>
16+
<Version>1.0.0</Version>
17+
<PackageVersion>1.0.0</PackageVersion>
1818
</PropertyGroup>
1919
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
2020
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>

ManagedCode.Storage.Aws/AWSStorage.cs

+3-20
Original file line numberDiff line numberDiff line change
@@ -149,28 +149,12 @@ public async Task<BlobMetadata> GetBlobAsync(string blobName, CancellationToken
149149
};
150150

151151
var objectMetaResponse = await _s3Client.GetObjectMetadataAsync(objectMetaRequest);
152-
153-
var objectAclRequest = new GetACLRequest
154-
{
155-
BucketName = _bucket,
156-
Key = blobName
157-
};
158-
159-
var objectAclResponse = await _s3Client.GetACLAsync(objectAclRequest);
160-
var isPublic = objectAclResponse.AccessControlList.Grants.Any(x => x.Grantee.URI == "http://acs.amazonaws.com/groups/global/AllUsers");
161-
152+
162153
return new BlobMetadata
163154
{
164155
Name = blobName,
165-
//Container = containerName,
166-
//Length = objectMetaResponse.Headers.ContentLength,
167-
//ETag = objectMetaResponse.ETag,
168-
//ContentMD5 = objectMetaResponse.ETag,
169-
//ContentType = objectMetaResponse.Headers.ContentType,
170-
//ContentDisposition = objectMetaResponse.Headers.ContentDisposition,
171-
//LastModified = objectMetaResponse.LastModified,
172-
//Security = isPublic ? BlobSecurity.Public : BlobSecurity.Private,
173-
//Metadata = objectMetaResponse.Metadata.ToMetadata(),
156+
Uri = new Uri($"https://s3.amazonaws.com/{_bucket}/{blobName}"),
157+
ContentType = objectMetaResponse.Headers.ContentType
174158
};
175159
}
176160

@@ -263,7 +247,6 @@ public async Task UploadFileAsync(string blobName, string pathToFile, Cancellati
263247
}
264248
}
265249

266-
267250
public async Task UploadFileAsync(BlobMetadata blobMetadata, string pathToFile, CancellationToken cancellationToken = default)
268251
{
269252
using (var fs = new FileStream(pathToFile, FileMode.Open, FileAccess.Read))

0 commit comments

Comments
 (0)