-
Notifications
You must be signed in to change notification settings - Fork 660
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
Why does MinIO not support overriding the Response Header value when calling GetObject? #1755
Comments
Support passing in a URL query string in GetObjectOptions.
Support passing in a URL query string in GetObjectOptions.
@reedchan7 Seems like we have an xy problem If you describe what you are trying to achieve, instead of a solution to an unknown problem it would be a lot easier to evaluate. response-content-type, response-content-language, response-content-disposition, response-content-encoding does not affect anything, since it would only make sense in a browser. You are receiving data back as a stream, so none of these matter. If you are concerned about the headers returned, why not just ignore them, instead of manually overriding? |
We will provide services both on the command-line terminal and the web browser, so even though these Headers may not be effective on the command-line terminal, they are still useful on the browser, including Expires and Content-Disposition, etc. Moreover, we have connected to several object storage services, such as Aliyun OSS, Tencent Cloud COS, and MinIO, we may extend to Amazon S3 and others. Therefore, we have abstracted the APIs of these services, however, this API behaves differently, hence the confusion above. However, I don't think this is a big problem now. If we have the requirement, I have forked a copy and implemented the support of overwriting these response-* headers. Later, if we think these headers are not important anymore, we can remove the related logic and switch back to your official implementation. Thank you for your reply and assistance! |
Response changes for standard header types are provided via presigned URLs for GetObject this has been supported since day 1. Use presignedGet API for what you want. |
@reedchan7 Makes sense. I don't see any issue with implementing them. They can easily be added without breaking compatibility. The easiest would probably be to just add them as supportedHeaders Then @harshavardhana This is something else. |
@klauspost I did this by adding a reqParams to GetObjectOptions and then adding some methods, similar to the presignedGet API. Is this okay? Support passing in a URL query string in GetObjectOptions |
@klauspost it is actually same functionality |
@reedchan7 that is the correct way to do it. |
@klauspost @harshavardhana Do you need a PR? |
@reedchan7 Yes, though un-export |
This allows you to pass in the response headers that you need to override when calling the GetObject method.
@klauspost @harshavardhana Here is the PR: #1756 I set I add a And then I wrote an example. Please review, thanks. |
This allows you to pass in the response headers that you need to override when calling the GetObject method.
This allows you to pass in the response headers that you need to override when calling the GetObject method.
MinIO's GetObject Option only supports passing in Request Headers, not response-header parameters to override Response Headers, whereas Amazon S3's documentation indicates that such parameters are supported.
MinIO's GetObject Documentation:
Amazon S3 Documentation:
https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html
Request Syntax:
Now, let's look into the code of MinIO Go SDK, we can find that only the parameters of versionId and PartNumber are supported while building HTTP Request, while other parameters are not supported.
What considerations are behind this? When will this feature be supported?
MinIO Go SDK Version:
v7.0.45
The text was updated successfully, but these errors were encountered: