From 610d55c26f0172515900878f062b4dd703f45775 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 24 Aug 2017 12:33:54 +0100 Subject: [PATCH] Fix override. Former-commit-id: 515874171ed00bf70db40b2fc302d479d18fe93a [formerly ea9e47252daae3fb211150e2c3ab67ac97067a32] [formerly 2b0378600c957da5e2610f3cf8e82dd079d11f65 [formerly e285195fe1647a4649c071b26b78f4b7dd9776da]] Former-commit-id: 05d03bb250d4bc6bc4b3dbaf388f79a682f09841 [formerly 4ef3ceb2dd3862011a09ae39fbf4a78b889100e4] Former-commit-id: 448224f282d6b14678f8d5d6629cbbe44ed19644 --- http/resource.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/http/resource.go b/http/resource.go index 39e9d0de..94ab280e 100644 --- a/http/resource.go +++ b/http/resource.go @@ -160,7 +160,7 @@ func resourcePostPutHandler(c *fm.Context, w http.ResponseWriter, r *http.Reques } // Discard any invalid upload before returning to avoid connection - // reset fm.Error. + // reset error. defer func() { io.Copy(ioutil.Discard, r.Body) }() @@ -179,9 +179,9 @@ func resourcePostPutHandler(c *fm.Context, w http.ResponseWriter, r *http.Reques } // If using POST method, we are trying to create a new file so it is not - // desirable to ovfm.Erride an already existent file. Thus, we check + // desirable to override an already existent file. Thus, we check // if the file already exists. If so, we just return a 409 Conflict. - if r.Method == http.MethodPost && r.Header.Get("Action") != "ovfm.Erride" { + if r.Method == http.MethodPost && r.Header.Get("Action") != "override" { if _, err := c.User.FileSystem.Stat(r.URL.Path); err == nil { return http.StatusConflict, errors.New("There is already a file on that path") }