airtasker / proxay

Proxay is a record/replay proxy server that helps you write faster and more reliable tests.
Other
76 stars 6 forks source link

Ability for strict request validation #536

Closed Ahbrown41 closed 10 months ago

Ahbrown41 commented 1 year ago

Hey! We are looking at your tool and it is great but was wondering if it could have an option for strict request validation such that if the request payload does not match exactly (Minus things like ignored headers) that the result would be an error or be empty.

Right now it appears to do fuzzy logic to find a reasonable response but in our case this is an issue.

Thanks!

timdawborn commented 1 year ago

Howdy,

You're right that there's no current functionality for doing exact matches rather than "best" matches. However, at least at first glance, it looks like it would be pretty straight forward to add. I believe https://github.com/airtasker/proxay/blob/b52aea6e3508965ed002d5ebdbf3ecb00306f702/src/matcher.ts#L71 is the only location that would need to change. An exact match would be a similarity score of 0.

Are you looking to potentially PR such a thing yourself? If so, that's hopefully enough to get you on the right track.

timdawborn commented 10 months ago

This functionality has been added in #556 and is available in the 1.7.0 release onwards.