diff --git a/pkg/api/routes.go b/pkg/api/routes.go index 04f9fa2b..f8eebd0a 100644 --- a/pkg/api/routes.go +++ b/pkg/api/routes.go @@ -725,7 +725,7 @@ func (rh *RouteHandler) DeleteBlob(response http.ResponseWriter, request *http.R // @Param name path string true "repository name" // @Success 202 {string} string "accepted" // @Header 202 {string} Location "/v2/{name}/blobs/uploads/{session_id}" -// @Header 202 {string} Range "bytes=0-0" +// @Header 202 {string} Range "0-0" // @Failure 404 {string} string "not found" // @Failure 500 {string} string "internal server error" // @Router /v2/{name}/blobs/uploads [post]. @@ -767,7 +767,7 @@ func (rh *RouteHandler) CreateBlobUpload(response http.ResponseWriter, request * } response.Header().Set("Location", getBlobUploadSessionLocation(request.URL, upload)) - response.Header().Set("Range", "bytes=0-0") + response.Header().Set("Range", "0-0") response.WriteHeader(http.StatusAccepted) return @@ -853,7 +853,7 @@ func (rh *RouteHandler) CreateBlobUpload(response http.ResponseWriter, request * } response.Header().Set("Location", getBlobUploadSessionLocation(request.URL, upload)) - response.Header().Set("Range", "bytes=0-0") + response.Header().Set("Range", "0-0") response.WriteHeader(http.StatusAccepted) } @@ -866,7 +866,7 @@ func (rh *RouteHandler) CreateBlobUpload(response http.ResponseWriter, request * // @Param session_id path string true "upload session_id" // @Success 204 {string} string "no content" // @Header 202 {string} Location "/v2/{name}/blobs/uploads/{session_id}" -// @Header 202 {string} Range "bytes=0-128" +// @Header 202 {string} Range "0-128" // @Failure 404 {string} string "not found" // @Failure 500 {string} string "internal server error" // @Router /v2/{name}/blobs/uploads/{session_id} [get]. @@ -912,7 +912,7 @@ func (rh *RouteHandler) GetBlobUpload(response http.ResponseWriter, request *htt } response.Header().Set("Location", getBlobUploadSessionLocation(request.URL, sessionID)) - response.Header().Set("Range", fmt.Sprintf("bytes=0-%d", size-1)) + response.Header().Set("Range", fmt.Sprintf("0-%d", size-1)) response.WriteHeader(http.StatusNoContent) } @@ -925,7 +925,7 @@ func (rh *RouteHandler) GetBlobUpload(response http.ResponseWriter, request *htt // @Param session_id path string true "upload session_id" // @Success 202 {string} string "accepted" // @Header 202 {string} Location "/v2/{name}/blobs/uploads/{session_id}" -// @Header 202 {string} Range "bytes=0-128" +// @Header 202 {string} Range "0-128" // @Header 200 {object} api.BlobUploadUUID // @Failure 400 {string} string "bad request" // @Failure 404 {string} string "not found" @@ -1004,7 +1004,7 @@ func (rh *RouteHandler) PatchBlobUpload(response http.ResponseWriter, request *h } response.Header().Set("Location", getBlobUploadSessionLocation(request.URL, sessionID)) - response.Header().Set("Range", fmt.Sprintf("bytes=0-%d", clen-1)) + response.Header().Set("Range", fmt.Sprintf("0-%d", clen-1)) response.Header().Set("Content-Length", "0") response.Header().Set(constants.BlobUploadUUID, sessionID) response.WriteHeader(http.StatusAccepted) diff --git a/pkg/compliance/v1_0_0/check.go b/pkg/compliance/v1_0_0/check.go index 0f8c53e1..976cb4c9 100644 --- a/pkg/compliance/v1_0_0/check.go +++ b/pkg/compliance/v1_0_0/check.go @@ -289,7 +289,7 @@ func CheckWorkflows(t *testing.T, config *compliance.Config) { So(resp.StatusCode(), ShouldEqual, http.StatusNoContent) r := resp.Header().Get("Range") So(r, ShouldNotBeEmpty) - So(r, ShouldEqual, "bytes="+contentRange) + So(r, ShouldEqual, contentRange) // write same chunk should fail contentRange = fmt.Sprintf("%d-%d", 0, len(chunk1)-1) @@ -357,7 +357,7 @@ func CheckWorkflows(t *testing.T, config *compliance.Config) { So(resp.StatusCode(), ShouldEqual, http.StatusNoContent) r := resp.Header().Get("Range") So(r, ShouldNotBeEmpty) - So(r, ShouldEqual, "bytes="+contentRange) + So(r, ShouldEqual, contentRange) // write same chunk should fail contentRange = fmt.Sprintf("%d-%d", 0, len(chunk1)-1) diff --git a/swagger/docs.go b/swagger/docs.go index c86ebffe..bb18e4ee 100644 --- a/swagger/docs.go +++ b/swagger/docs.go @@ -186,7 +186,7 @@ var doc = `{ }, "Range": { "type": "string", - "description": "bytes=0-0" + "description": "0-0" } } }, diff --git a/swagger/swagger.json b/swagger/swagger.json index 054bb4ae..d2230e80 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -168,7 +168,7 @@ }, "Range": { "type": "string", - "description": "bytes=0-0" + "description": "0-0" } } }, @@ -371,7 +371,7 @@ }, "Range": { "type": "string", - "description": "bytes=0-128" + "description": "0-128" } } }, diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index 23b912cd..e0385d27 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -206,7 +206,7 @@ paths: description: /v2/{name}/blobs/uploads/{session_id} type: string Range: - description: bytes=0-0 + description: 0-0 type: string schema: type: string @@ -307,7 +307,7 @@ paths: description: /v2/{name}/blobs/uploads/{session_id} type: string Range: - description: bytes=0-128 + description: 0-128 type: string schema: type: string