mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #106576 from liggitt/bad-request-patch
Return BadRequest for invalid large patch
This commit is contained in:
commit
a8c9dd6274
@ -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