0

Explicitly ignore io.Copy's return values (#352)

We're probably ignoring any errors here, since we're writing to a memory
buffer here. Let's make it clear we didn't just forget to check, but
really want to ignore these values.
This commit is contained in:
Christian Muehlhaeuser 2020-11-12 23:42:01 +01:00 committed by GitHub
parent 2c504eb8be
commit 3f9dd2870f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,8 +55,9 @@ func (s *FileWriterReceiverService) uploadHandler(w http.ResponseWriter, r *http
writePath := filepath.Join(config.PrivateHLSStoragePath, path)
var buf bytes.Buffer
io.Copy(&buf, r.Body)
_, _ = io.Copy(&buf, r.Body)
data := buf.Bytes()
f, err := os.Create(writePath)
if err != nil {
returnError(err, w, r)