diff --git a/pkg/api/controller_test.go b/pkg/api/controller_test.go index 08cd4be1..5d870203 100644 --- a/pkg/api/controller_test.go +++ b/pkg/api/controller_test.go @@ -2665,7 +2665,7 @@ func TestCrossRepoMount(t *testing.T) { SetBasicAuth(username, passphrase).SetQueryParams(params). Post(baseURL + "/v2/zot-mount-test/blobs/uploads/") So(err, ShouldBeNil) - So(postResponse.StatusCode(), ShouldEqual, http.StatusMethodNotAllowed) + So(postResponse.StatusCode(), ShouldEqual, http.StatusAccepted) params = make(map[string]string) params["from"] = "zot-cve-test" @@ -3902,7 +3902,7 @@ func TestRouteFailures(t *testing.T) { resp = response.Result() defer resp.Body.Close() So(resp, ShouldNotBeNil) - So(resp.StatusCode, ShouldEqual, http.StatusMethodNotAllowed) + So(resp.StatusCode, ShouldEqual, http.StatusAccepted) }) Convey("Get blob upload", func() { diff --git a/pkg/api/routes.go b/pkg/api/routes.go index 9dcdd5a2..cc2ee998 100644 --- a/pkg/api/routes.go +++ b/pkg/api/routes.go @@ -716,13 +716,6 @@ func (rh *RouteHandler) CreateBlobUpload(response http.ResponseWriter, request * return } - from, ok := request.URL.Query()["from"] - if !ok || len(from) != 1 { - response.WriteHeader(http.StatusMethodNotAllowed) - - return - } - // zot does not support cross mounting directly and do a workaround creating using hard link. // check blob looks for actual path (name+mountDigests[0]) first then look for cache and // if found in cache, will do hard link and if fails we will start new upload.