From 42f7f8cc2948100bc4db0b579abab4eb15aa8373 Mon Sep 17 00:00:00 2001 From: Marcos Lilljedahl Date: Thu, 6 Oct 2022 15:30:48 -0300 Subject: [PATCH] Ensure content is properly flushed before returning to the user Fixes #553 Signed-off-by: Marcos Lilljedahl --- handlers/file_instance.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/handlers/file_instance.go b/handlers/file_instance.go index 2d7e3fc..cd03baf 100644 --- a/handlers/file_instance.go +++ b/handlers/file_instance.go @@ -36,7 +36,6 @@ func file(rw http.ResponseWriter, req *http.Request) { } instanceFile, err := core.InstanceFile(i, path) - if err != nil { log.Println(err) rw.WriteHeader(http.StatusInternalServerError) @@ -50,4 +49,6 @@ func file(rw http.ResponseWriter, req *http.Request) { rw.WriteHeader(http.StatusInternalServerError) return } + + encoder.Close() }