mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Return BadRequest for invalid large patch
This commit is contained in:
parent
ed07515ee0
commit
2d307f47bd
@ -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
Block a user