add content range handling in patch blob
Fixes #3141 1, return 416 for Out-of-order blob upload 2, return 400 for content length and content size mismatch Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
@@ -32,6 +32,17 @@ var (
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
})
|
||||
|
||||
// ErrorCodeRangeInvalid is returned when uploading a blob if the provided
|
||||
// content range is invalid.
|
||||
ErrorCodeRangeInvalid = errcode.Register(errGroup, errcode.ErrorDescriptor{
|
||||
Value: "RANGE_INVALID",
|
||||
Message: "invalid content range",
|
||||
Description: `When a layer is uploaded, the provided range is checked
|
||||
against the uploaded chunk. This error is returned if the range is
|
||||
out of order.`,
|
||||
HTTPStatusCode: http.StatusRequestedRangeNotSatisfiable,
|
||||
})
|
||||
|
||||
// ErrorCodeNameInvalid is returned when the name in the manifest does not
|
||||
// match the provided name.
|
||||
ErrorCodeNameInvalid = errcode.Register(errGroup, errcode.ErrorDescriptor{
|
||||
|
Reference in New Issue
Block a user