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

Add length check for empty policy content #326

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

shtripat
Copy link
Contributor

If an empty file used as input for policy creation a zero sized byte array gets passed. Corrected the check to see length and if it's zero, error out.

Fixes: minio/mc#5108

If an empty file used as input for policy creation a zero sized
byte array gets passed. Corrected the check to see length and if
it's zero, error out. Earlier error was confusing as below
```
mc: <ERROR> Unable to create new policy. You must provide the Content-Length HTTP header.
```

Signed-off-by: Shubhendu Ram Tripathi <[email protected]>
@harshavardhana harshavardhana merged commit dae7ce4 into minio:main Jan 16, 2025
6 checks passed
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.

If policy file is empty, mc requests the user provides a Content-Length header
2 participants