Browse Source

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.
pull/355/head
Christian Muehlhaeuser 5 years ago committed by GitHub
parent
commit
3f9dd2870f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      core/ffmpeg/fileWriterReceiverService.go

3
core/ffmpeg/fileWriterReceiverService.go

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

Loading…
Cancel
Save