Open ivanjx opened 1 year ago
there is a workaround though by using the SignObject method:
...
string url = client.SignGetObject("testbucket", "objectname22", TimeSpan.FromMinutes(1));
Console.WriteLine("Url: {0}", url);
using HttpClient http = new HttpClient();
using Stream resp2Data = await http.GetStreamAsync(url);
using StreamReader reader2 = new StreamReader(resp2Data);
Console.WriteLine("Content Stream: [{0}]", await reader2.ReadToEndAsync());
...
Content: []
Url: https://play.min.io/testbucket/objectname22?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=1nM2dy8VWatJ7EJ4nEBg%2F20230805%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230805T041311Z&X-Amz-Expires=60&X-Amz-SignedHeaders=host&X-Amz-Signature=e1f575228ce0bcb0aae4d713bc620ad2ecc2f926f8221ed7955dc7382cd94298
Content Stream: [Hello World!! + 2023-08-05T04:13:10.2145266Z]
Success: True
Interesting. I'll try and debug it once I get the time for it.
I've taken a look at it now. There are several issues:
Other potential problems:
I've tried to root all assemblies, which should remove the trimming issues, but the application still crash - likely due to RequestMarshal being setup via DI.
So for the moment, NativeAOT is not supported by SimpleS3.
Description of the bug PutObject works fine under NativeAOT but when i tried to get the file back with GetObject it gives me an empty stream instead. I manually verified that the PutObject works fine on both normal and AOT mode by downloading and checking the file myself.
How to reproduce?
compile with:
dotnet publish -c Release
normal output:
NativeAOT output:
Expected behavior GetObject's Content has data in it.