Repository navigation
Description
Description
_methodStatusCode only has entries for GET, POST, PUT, PATCH and DELETE. For any other method (HEAD, OPTIONS, …), the lookup _methodStatusCode[method] throws KeyNotFoundException.
Code:
dev-proxy/DevProxy.Plugins/Behavior/GraphRandomErrorPlugin.cs
Lines 52 to 102 in 43b3724
private readonly Dictionary<string, HttpStatusCode[]> _methodStatusCode = new() { { "GET", new[] { HttpStatusCode.TooManyRequests, HttpStatusCode.InternalServerError, HttpStatusCode.BadGateway, HttpStatusCode.ServiceUnavailable, HttpStatusCode.GatewayTimeout } }, { "POST", new[] { HttpStatusCode.TooManyRequests, HttpStatusCode.InternalServerError, HttpStatusCode.BadGateway, HttpStatusCode.ServiceUnavailable, HttpStatusCode.GatewayTimeout, HttpStatusCode.InsufficientStorage } }, { "PUT", new[] { HttpStatusCode.TooManyRequests, HttpStatusCode.InternalServerError, HttpStatusCode.BadGateway, HttpStatusCode.ServiceUnavailable, HttpStatusCode.GatewayTimeout, HttpStatusCode.InsufficientStorage } }, { "PATCH", new[] { HttpStatusCode.TooManyRequests, HttpStatusCode.InternalServerError, HttpStatusCode.BadGateway, HttpStatusCode.ServiceUnavailable, HttpStatusCode.GatewayTimeout } }, { "DELETE", new[] { HttpStatusCode.TooManyRequests, HttpStatusCode.InternalServerError, HttpStatusCode.BadGateway, HttpStatusCode.ServiceUnavailable, HttpStatusCode.GatewayTimeout, HttpStatusCode.InsufficientStorage } } }; var methodStatusCodes = _methodStatusCode[e.ProxySession.Request.Method]; var methodStatusCodes = _methodStatusCode[request.Method];
Expected behavior
Requests with other methods either pass through or get a generic error, without an exception.
Metadata
Metadata
Assignees
Labels
No labels
Activity
waldekmastykarz commentedon Oct 21, 2026
Fixed by #1990: methods with no allowed error codes, including methods missing from the built-in list such as HEAD and OPTIONS, now pass through. This issue will close when that PR merges.