diff --git a/fakestorage/server.go b/fakestorage/server.go index d851685b98..faa50532a7 100644 --- a/fakestorage/server.go +++ b/fakestorage/server.go @@ -264,7 +264,6 @@ func (s *Server) buildMuxer() { r.Path("/b/{bucketName}").Methods(http.MethodPatch).HandlerFunc(jsonToHTTPHandler(s.updateBucket)) r.Path("/b/{bucketName}").Methods(http.MethodDelete).HandlerFunc(jsonToHTTPHandler(s.deleteBucket)) r.Path("/b/{bucketName}/o").Methods(http.MethodGet).HandlerFunc(jsonToHTTPHandler(s.listObjects)) - r.Path("/b/{bucketName}/o").Methods(http.MethodPost).HandlerFunc(jsonToHTTPHandler(s.insertObject)) r.Path("/b/{bucketName}/o/{objectName:.+}").Methods(http.MethodPatch).HandlerFunc(jsonToHTTPHandler(s.patchObject)) r.Path("/b/{bucketName}/o/{objectName:.+}/acl").Methods(http.MethodGet).HandlerFunc(jsonToHTTPHandler(s.listObjectACL)) r.Path("/b/{bucketName}/o/{objectName:.+}/acl").Methods(http.MethodPost).HandlerFunc(jsonToHTTPHandler(s.setObjectACL)) diff --git a/fakestorage/upload_test.go b/fakestorage/upload_test.go index fe2ccef8c8..79908fa42d 100644 --- a/fakestorage/upload_test.go +++ b/fakestorage/upload_test.go @@ -489,7 +489,7 @@ func TestServerClientSimpleUpload(t *testing.T) { const data = "some nice content" const contentType = "text/plain" - req, err := http.NewRequest("POST", server.URL()+"/storage/v1/b/other-bucket/o?uploadType=media&name=some/nice/object.txt", strings.NewReader(data)) + req, err := http.NewRequest("POST", server.URL()+"/upload/storage/v1/b/other-bucket/o?uploadType=media&name=some/nice/object.txt", strings.NewReader(data)) if err != nil { t.Fatal(err) } @@ -633,7 +633,7 @@ func TestServerClientUploadWithPredefinedAclPublicRead(t *testing.T) { } compressed := buf.Bytes() - req, err := http.NewRequest("POST", server.URL()+"/storage/v1/b/other-bucket/o?predefinedAcl=publicRead&uploadType=media&name=some/nice/object.txt&contentEncoding="+contentEncoding, bytes.NewReader(compressed)) + req, err := http.NewRequest("POST", server.URL()+"/upload/storage/v1/b/other-bucket/o?predefinedAcl=publicRead&uploadType=media&name=some/nice/object.txt&contentEncoding="+contentEncoding, bytes.NewReader(compressed)) if err != nil { t.Fatal(err) } @@ -690,7 +690,7 @@ func TestServerClientSimpleUploadNoName(t *testing.T) { server.CreateBucketWithOpts(CreateBucketOpts{Name: "other-bucket"}) const data = "some nice content" - req, err := http.NewRequest("POST", server.URL()+"/storage/v1/b/other-bucket/o?uploadType=media", strings.NewReader(data)) + req, err := http.NewRequest("POST", server.URL()+"/upload/storage/v1/b/other-bucket/o?uploadType=media", strings.NewReader(data)) if err != nil { t.Fatal(err) } @@ -715,7 +715,7 @@ func TestServerInvalidUploadType(t *testing.T) { defer server.Stop() server.CreateBucketWithOpts(CreateBucketOpts{Name: "other-bucket"}) const data = "some nice content" - req, err := http.NewRequest("POST", server.URL()+"/storage/v1/b/other-bucket/o?uploadType=bananas&name=some-object.txt", strings.NewReader(data)) + req, err := http.NewRequest("POST", server.URL()+"/upload/storage/v1/b/other-bucket/o?uploadType=bananas&name=some-object.txt", strings.NewReader(data)) if err != nil { t.Fatal(err) }