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

Expose gzip.Reader.Multistream #407

Merged
merged 1 commit into from
Jun 13, 2024
Merged

Conversation

rgmz
Copy link
Contributor

@rgmz rgmz commented Jun 13, 2024

Somewhat related to #405, it turns out that compress/gzip has a feature to handle trailing data without returning an error.

If you would like the ability to read a valid gzip member and specially handle non-gzip data after the member, then you can use the gzip.Reader.Multistream feature to read the file one member at a time.

golang/go#47809

I created a field called DisableMultistream and not Multistream because gzip.Reader.Multistream is enabled by default. The latter would silently disable Multistream for any existing instances of archiver.Gz{}.

Additional Context

trufflesecurity/trufflehog#2934

Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I have the stupidest style nits to pick with this 😅 but then we can get it merged in right away.

gz.go Show resolved Hide resolved
gz.go Outdated Show resolved Hide resolved
gz.go Outdated Show resolved Hide resolved
@rgmz
Copy link
Contributor Author

rgmz commented Jun 13, 2024

Done!

Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool -- let's try it. Thanks!

@mholt mholt merged commit 07b70a6 into mholt:master Jun 13, 2024
3 checks passed
@rgmz rgmz deleted the feat/gzip-multistream branch June 13, 2024 19:11
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