0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

mocked tests for routes

Signed-off-by: laurentiuNiculae <themelopeus@gmail.com>
This commit is contained in:
laurentiuNiculae 2022-04-13 09:28:43 +03:00 committed by Ramkumar Chinchani
parent 287ac05ddc
commit 7d8af50aec
2 changed files with 1642 additions and 8 deletions

View file

@ -955,14 +955,6 @@ func (rh *RouteHandler) PatchBlobUpload(response http.ResponseWriter, request *h
return
}
contentRange := request.Header.Get("Content-Range")
if contentRange == "" {
rh.c.Log.Warn().Str("actual", request.Header.Get("Content-Range")).Msg("invalid content range")
response.WriteHeader(http.StatusRequestedRangeNotSatisfiable)
return
}
var from, to int64
if from, to, err = getContentRange(request); err != nil || (to-from)+1 != contentLength {
response.WriteHeader(http.StatusRequestedRangeNotSatisfiable)

1642
pkg/api/routes_test.go Normal file

File diff suppressed because it is too large Load diff