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

fix: s3 backend requires nil values for input params #1100

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

benmcclelland
Copy link
Member

For any uninitialized input values, the s3 sdk expects these to be set to nil instead of the type zero value. Setting to the zero value is incorrectly making the server request think we are trying to set those parameters.

This sets all input parameters to nil for the default values. Many of these are already nil from the frontend, but this should protect against a future addition of input params for an api requests and not remembering to add teh zero value check on in the s3 backend.

We were previously getting the following error for put-object: InvalidArgumentx-amz-object-lock-retain-until-date and x-amz-object-lock-mode must both be supplied

For any uninitialized input values, the s3 sdk expects these to
be set to nil instead of the type zero value. Setting to the zero
value is incorrectly making the server request think we are
trying to set those parameters.

This sets all input parameters to nil for the default values. Many
of these are already nil from the frontend, but this should
protect against a future addition of input params for an api
requests and not remembering to add teh zero value check on in
the s3 backend.

We were previously getting the following error for put-object:
<Error><Code>InvalidArgument</Code><Message>x-amz-object-lock-retain-until-date and x-amz-object-lock-mode must both be supplied</Message><Resource></Resource><RequestId></RequestId><HostId></HostId></Error>
@benmcclelland benmcclelland merged commit 62c6fbd into main Feb 28, 2025
24 checks passed
@benmcclelland benmcclelland deleted the ben/s3proxy-sdk-input-fields branch February 28, 2025 22:40
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

Successfully merging this pull request may close these issues.

2 participants