Ensure content is properly flushed before returning to the user

Fixes #553

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
This commit is contained in:
Marcos Lilljedahl
2022-10-06 15:30:48 -03:00
parent d724243282
commit 42f7f8cc29

View File

@@ -36,7 +36,6 @@ func file(rw http.ResponseWriter, req *http.Request) {
} }
instanceFile, err := core.InstanceFile(i, path) instanceFile, err := core.InstanceFile(i, path)
if err != nil { if err != nil {
log.Println(err) log.Println(err)
rw.WriteHeader(http.StatusInternalServerError) rw.WriteHeader(http.StatusInternalServerError)
@@ -50,4 +49,6 @@ func file(rw http.ResponseWriter, req *http.Request) {
rw.WriteHeader(http.StatusInternalServerError) rw.WriteHeader(http.StatusInternalServerError)
return return
} }
encoder.Close()
} }