justeattakeaway / httpclient-interception

A .NET library for intercepting server-side HTTP requests
https://tech.just-eat.com/2017/10/02/reliably-testing-http-integrations-in-a-dotnet-application/
Apache License 2.0
361 stars 27 forks source link

Ignore order of query params #651

Open drewburlingame opened 1 year ago

drewburlingame commented 1 year ago

Is your feature request related to a problem? Please describe.

We have urls generated by a 3rd party framework and the order some query params are added is not always deterministic.

It would be helpful if the matcher was able to determine if query params were the same when not added in the same order.

Describe the solution you'd like

Ideally this would just work. If there's concern of introducing a breaking change, consider adding a property like HttpClientInterceptorOptions.IgnoreQueryParamOrder.

The matcher would split the query string into parts before comparing.

Describe alternatives you've considered

I created a custom matcher to do this, but I don't want to copy that code into every solution that uses this package and it seems silly to create a custom nuget just for that.

martincostello commented 1 year ago

This sounds reasonable - would you like to submit a PR with a proposed implementation?

drewburlingame commented 1 year ago

I can do that. With my current bandwidth restrictions it will likley be a few weeks before I will get to it.

silkfire commented 9 months ago

@drewburlingame Any status on this? Would have been really useful.

drewburlingame commented 9 months ago

@silkfire no progress. We ended up using a slightly different approach before I could get to this and it's now a low priority. I don't know when or if I'll be able to work on this.