pull/157/head
Henrique Dias 2017-07-23 20:30:55 +01:00
parent 71f31f5948
commit 318844c83e
No known key found for this signature in database
GPG Key ID: 936F5EB68D786730
1 changed files with 1 additions and 2 deletions

View File

@ -162,11 +162,10 @@ func resourcePostPutHandler(c *RequestContext, w http.ResponseWriter, r *http.Re
// Create/Open the file. // 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) 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 { if err != nil {
return errorToHTTP(err, false), err return errorToHTTP(err, false), err
} }
defer f.Close()
// Copies the new content for the file. // Copies the new content for the file.
_, err = io.Copy(f, r.Body) _, err = io.Copy(f, r.Body)