fix #150
Former-commit-id: 87e07b171f5713e2f8adc59229d3dacb96414a29 [formerly 80075ac7ebb0ab56ddb6375b03b99c49c0544019] [formerly f26942fe90cbfa6002e4603d18ee790b0b9cc438 [formerly 318844c83e
]]
Former-commit-id: f7447c7b2fa075687e5f3bb1d4bbb9302ae3bd80 [formerly fbc89b810f003064dff5e720257f0be8bcd3ed9a]
Former-commit-id: 11136729184d0bab7f3345da43adefe29ed0e548
pull/726/head
parent
85be80b661
commit
b51689efbe
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue