summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Hurst <julian.hurst@digdash.com>2025-01-28 10:36:54 +0100
committerJulian Hurst <julian.hurst@digdash.com>2025-01-28 10:36:54 +0100
commit2314ace2d7d1a92010708a9f0e3208cc1068594e (patch)
tree3ea6f5156d05475afb7b472bd1376021d3ba6ff6
parent7b81f3c7687d1f55410a88298e89c53ab14e41c1 (diff)
downloadbox-2314ace2d7d1a92010708a9f0e3208cc1068594e.tar.gz
Close created file in upload
-rw-r--r--main.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.go b/main.go
index 2df8a6f..b9bf651 100644
--- a/main.go
+++ b/main.go
@@ -123,6 +123,7 @@ func (handler BoxHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, err.Error())
return
}
+ defer f.Close()
defer r.Body.Close()
io.Copy(f, r.Body)
w.Header().Add("X-Resource-ID", filepath.Base(filename))