-
Notifications
You must be signed in to change notification settings - Fork 47
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
Ensure empty files do not have a mimetype #104
Conversation
Benchmark Test ResultsBenchmark results from the latest changes vs base branch
|
2b3be21
to
a16e227
Compare
Signed-off-by: Alex Goodman <[email protected]>
a16e227
to
e985f72
Compare
expected: "text/plain", | ||
}, | ||
{ | ||
// no contents | ||
fixture: "", | ||
name: "no contents", |
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.
Maybe add a directory example?
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.
since this function takes a reader it's not possible to pass it a directory
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.
LGTM with a test suggestion
Today it seems that non-nil readers to files with no contents are resulting in
text/plain
MIME types, which is incorrect. We should return no MIME type. This PR makes this adjustment by ensuring the size of read bytes is not 0.Related to anchore/syft#782