From 318844c83e226cf66e7f43858260b1f4c9737b60 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sun, 23 Jul 2017 20:30:55 +0100 Subject: [PATCH] fix #150 --- resource.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resource.go b/resource.go index d852024a..a6b6595f 100644 --- a/resource.go +++ b/resource.go @@ -162,11 +162,10 @@ func resourcePostPutHandler(c *RequestContext, w http.ResponseWriter, r *http.Re // Create/Open the file. f, err := c.User.FileSystem.OpenFile(context.TODO(), r.URL.Path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666) - defer f.Close() - if err != nil { return errorToHTTP(err, false), err } + defer f.Close() // Copies the new content for the file. _, err = io.Copy(f, r.Body)