Return nil on success for web UI file tranfers (#15021)

When we download, we write the file contents with the 
`http.ResponseWriter` which is also used to write our 
replies, so it was also writing our success replies.

fixes https://github.com/gravitational/teleport/issues/14557
This commit is contained in:
Lisa Kim
2022-07-29 17:47:35 +00:00
committed by GitHub
parent 7d6f34244a
commit 3a3a0cf8a7
+3 -1
View File
@@ -79,7 +79,9 @@ func (h *Handler) transferFile(w http.ResponseWriter, r *http.Request, p httprou
return nil, trace.Wrap(err)
}
return OK(), nil
// We must return nil so that we don't write anything to
// the response, which would corrupt the downloaded file.
return nil, nil
}
type fileTransfer struct {