-
Notifications
You must be signed in to change notification settings - Fork 654
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
validate put object content length #2690
Conversation
}) | ||
|
||
_, err := svc.PutObject(context.Background(), cs.Input) | ||
if cs.ExpectErr && !strings.Contains(err.Error(), errNoContentLength.Error()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] can this be compared with errors.Is
or errors.As
instead of doing string comparisons?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah not sure what I was doing here. This is errors.Is
with extra steps
"github.com/aws/smithy-go/middleware" | ||
) | ||
|
||
var errNoContentLength = errors.New( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice error message
This reverts commit 2f18ba5. revert
This reverts commit 2f18ba5. revert
* Revert "validate put object content length (#2690)" This reverts commit 2f18ba5. revert * add changelog --------- Co-authored-by: Tianyi Wang <[email protected]>
Add specific validation for content-length presence in PutObject, see middleware docs
Closes #2683 or at least mitigates it somewhat