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:
parent
287ac05ddc
commit
7d8af50aec
2 changed files with 1642 additions and 8 deletions
|
@ -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
1642
pkg/api/routes_test.go
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue