Return BadRequest for invalid large patch
Kubernetes-commit: 2d307f47bd43902ee8f15751130dcbf4a4f775bf
This commit is contained in:
parent
4f539826fa
commit
f0c214506c
|
|
@ -412,6 +412,9 @@ func (p *jsonPatcher) applyJSPatch(versionedJS []byte) (patchedJS []byte, strict
|
||||||
}
|
}
|
||||||
|
|
||||||
patchedJS, retErr = jsonpatch.MergePatch(versionedJS, p.patchBytes)
|
patchedJS, retErr = jsonpatch.MergePatch(versionedJS, p.patchBytes)
|
||||||
|
if retErr == jsonpatch.ErrBadJSONPatch {
|
||||||
|
return nil, nil, errors.NewBadRequest(retErr.Error())
|
||||||
|
}
|
||||||
return patchedJS, strictErrors, retErr
|
return patchedJS, strictErrors, retErr
|
||||||
default:
|
default:
|
||||||
// only here as a safety net - go-restful filters content-type
|
// only here as a safety net - go-restful filters content-type
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue