Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I presign a StatObjectUrl #852

Open
fissssssh opened this issue Aug 26, 2023 · 1 comment
Open

How can I presign a StatObjectUrl #852

fissssssh opened this issue Aug 26, 2023 · 1 comment

Comments

@fissssssh
Copy link

fissssssh commented Aug 26, 2023

I didn't find an API like PresignedStatObject in the API, but there is PresignedHeadObject in the Go SDK.
Currently, this is the only way I can do it,

var args = new PresignedGetObjectArgs().WithBucket(bucket).WithObject(object).WithExpiry(expiry);

var fieldInfo = typeof(PresignedGetObjectArgs).GetProperty("RequestMethod", BindingFlags.NonPublic | BindingFlags.Instance);
fieldInfo?.SetValue(args, HttpMethod.Head);

return _client.PresignedGetObjectAsync(args); // This URL is the one I'm looking for.

but I feel it's not native.

@martijn00
Copy link
Contributor

Can you open a PR to add this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants