New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache to match on request headers #203
Comments
Right now we ignore headers, because depending on your client different ones may be generated alongside your requests - you'd have to be specific about which subset of headers you want to match on. It does seem reasonable that different test users might require different responses for the same endpoint. You could always spin up one hoverfly per user though and load different data into it. We should look into this further. |
Just a thought. What about making the hash function that is used to create the key for looking up the response an optional argument to hoverfly? Similar to how middleware is passed in. |
Hmm, yeah, I was hoping for it to be something similar to Wiremock's |
We could do that, it would be quite a large change - I think this is a wider problem space of partial matching in general, on all parts of the request. Right now there is good performance from using key value lookups but matching probably needs to be optionally looser. |
Hey @Anujan Since this ticket, we've introduced a the ability to create request templates that allow you to optionally match on any part of a request, including headers. This isn't the same as changing the hashing algorithm to include headers but it does achieve the same result. |
Is it possible to allow for certain headers to be matched on? For example, I'd like to hit the same URL with two different auth headers, have it return different data and cache both responses. The current behavior seems to overwrite the previous cache result if the URLs match.
The text was updated successfully, but these errors were encountered: