How to Preserve Case Sensitivity for Custom Headers in MinIO .NET SDK's Presigned URLs?

94 Views Asked by At

I'm using MinIO in conjunction with the .NET SDK to generate presigned URLs for object downloads. I have a specific requirement to include a custom header in the presigned URL with case sensitivity preserved. However, when I attempt to add headers to the PresignedGetObjectArgs, it appears that the headers are transformed to lowercase in the resulting URL.

Here's a simplified version of the code I'm using:

var args = new PresignedGetObjectArgs()
    .WithBucket(model.BucketName)
    .WithExpiry(model.ExpireIn)
    .WithHeaders(new Dictionary<string, string> { { "versionId", model.VersionId } });

return _minioClient.PresignedGetObjectAsync(args);

The problem is that the resulting URL ends up with lowercase headers, like this: http://127.0.0.1:9000/testbucket/1.png?[..someheaders]&versionid=somevalue

What I want is for the custom header "versionId" to retain its original case sensitivity in the presigned URL, like this: http://127.0.0.1:9000/testbucket/1.png?[..someheaders]&versionId=somevalue

Is there a way to achieve this case-sensitive preservation for custom headers in MinIO's .NET SDK when generating presigned URLs?

0

There are 0 best solutions below