You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In admission/webhook/server.go, the admission webhook server has two issues:
In handleWebhookValidate, the validator is invoked with context.TODO() instead of req.Context(). As a result, if the API server disconnects or times out during validation, the validation cannot be cancelled, wasting CPU.
In parseRequest, the Content-Type header is checked with exact string equality (r.Header.Get("Content-Type") != "application/json"). Requests with standard media type parameters (such as application/json; charset=utf-8) are rejected with 400 Bad Request.
Steps To Reproduce
Send an AdmissionReview request with Content-Type: application/json; charset=utf-8 to /validate.
Notice the request fails with 400 Bad Request.
Observe that incoming request context cancellation does not propagate to validator.Validate().
Expected behavior
The webhook should accept application/json along with optional media type parameters such as charset=utf-8.
The webhook should pass req.Context() to validator.Validate() so cancellation propagates properly.
Actual Behavior
Requests with media type parameters are rejected with 400 Bad Request.
context.TODO() is passed to validator.Validate(), ignoring client cancellation or timeouts.
Activity
Rucha0901 commentedon Nov 14, 2026
@matthyx ,I am working on this issue and soon will raise a PR .
please let me know if you have any suggestions.
thanks.