gpget
gpget copied to clipboard
Don't perform io.ReadAll on http response
As per @mischief:
[15:43] don't readfull here https://github.com/brianredbeard/gpget/blob/master/main.go#L136
[15:43] your File.content could probably just be a io.Reader
[15:44] if someone tries to e.g. download a 8G disk image with this, and they only have 8G memory, it will just OOM
Fixes issue called out in TODO.md
One thing with this is that the user should be able to make an active decision about if this ever touches the disk. In that case io.ReadAll may be an appropriate answer (as it is in the case of the signatures since they should be completely discarded after use). Will continue to explore further.