You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the MinIO .NET SDK, I encountered an issue where the HttpStatusCode in the PutObjectResponse is internal, making it inaccessible after receiving a response. However, in AWS S3's SDK, the same property is public, which allows developers to easily access the status code of the operation.
Code:
Here’s an example of how the MinIO SDK currently handles the HttpStatusCode:
Please consider changing the visibility of ResponseStatusCode from internal to public to align with the behavior of AWS S3's SDK and
improve usability.
Environment:
MinIO .NET SDK version: 6.0.3.0
.NET version: 8.0
Operating system: Windows
The text was updated successfully, but these errors were encountered:
minhaz109074
changed the title
Status code in PutObjectResponse is internal, unlike AWS S3's public implementation
Status code in PutObjectResponse is internal, unlike AWS S3's implementation
Sep 11, 2024
Would be really nice if #1195 would be merged and released soon given how small of a change it is and how much of an inconvenience it can be (#1176).
In our own case, we ended up losing some files sent to a S3 compatible storage due to assuming that if no exception was thrown the upload must have been successful.
It is currently, to my knowledge impossible to detect those kind of issues if you don't access the internal values using Reflection.
Here's how you can do it for the time being:
...
var putObjectResponse = await client.PutObjectAsync(args);
var putObjectResponseType = putObjectResponse.GetType();
var httpStatusCode = (System.Net.HttpStatusCode) putObjectResponseType.GetProperty(
"ResponseStatusCode",
System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.Instance
)
.GetValue(putObjectResponse);
var responseContent = (string) putObjectResponseType.GetProperty(
"ResponseContent",
Reflection.BindingFlags.NonPublic |
Reflection.BindingFlags.Instance
)
.GetValue(putObjectResponse);
Description:
In the MinIO .NET SDK, I encountered an issue where the
HttpStatusCode
in thePutObjectResponse
is internal, making it inaccessible after receiving a response. However, in AWS S3's SDK, the same property is public, which allows developers to easily access the status code of the operation.Code:
Here’s an example of how the MinIO SDK currently handles the
HttpStatusCode
:Suggestion:
Please consider changing the visibility of ResponseStatusCode from internal to public to align with the behavior of AWS S3's SDK and
improve usability.
Environment:
The text was updated successfully, but these errors were encountered: