DLMousey / Pyromaniac

ASP.NET Core middleware that pseudo-randomly burns responses to keep devs on their toes
MIT License
3 stars 2 forks source link

Make http status code configurable #5

Open DLMousey opened 1 year ago

DLMousey commented 1 year ago

Something i neglected to mention on the feature wish list is that the pseudo-random status code selection should be configurable, this would be dictated by 2 keys in the config along the lines of defaultStatusCode (the code that will be returned if no random code has been selected) and statusCodeInvokeChance (the chance of a pseudo-random status code being selected).

Not married to these names they might change during development. This builds on the work done in PR #4

alirzasahb commented 1 year ago

Alternatively, for pseudo-random status code, we return a totally random status code from a built-in valid status codes array (if there is no configuration) rather than specified status codes in configuration. This also makes default built-in behavior with no required/additional configuration.

What do you think?