v0.11.0
Its been a month in the making. v0.11.0 is here with a bevy of improvements, building on already existing functionality.
Request matchers (including support for XML and JSON matching, XPATH, JSONPATH and regex)
Originally, Hoverfly only supported "recordings". An incoming request had to exactly match a stored request for a response to be returned.
Since the introduction of templates, it was clear that the way we match requests in Hoverfly needed to improve. v0.11.0 brings the first phase of those improvements.
Recordings are now treated like templates, meaning it is even easier and simpler to modify a captured request and turn it into a looser fitting template.
Instead of defining request field values exactly, we have introduced a new set of matchers. Each request field (except headers) will now take an object of matchers. These matchers have allowed us to add new ways of matching data. For example, it is now possible to match a request body based on an XPath expression.
This change has resulted in the Hoverfly schema being updated to v2
. When importing an older v1
schemaVersion
simulation, Hoverfly will automatically upgrade it to v2
.
More information on request matchers
Caching requests
Previous versions of Hoverfly used a cache to store request recordings. The issue with this was you could not cache request templates, meaning a slower response time than with recording.
v0.11.0 has changed the way the cache works. Now, responses are stored against incoming requests meaning Hoverfly should now perform consistently regardless of how "loose" your simulation is.
The cache will be reloaded from your simulation every time you enter simulate mode. We have also added API endpoints for both viewing the state of the cache as well as flushing it.
More information on the logs API
Capture mode and headers
We've changed capture mode so now by default, when you capture requests, request headers ill not be captured. This is due to the way the cache works with hashes of the request. Now, if you want to capture headers, you will need to specify them when setting capture mode.
In hoverctl, we have added two new flags to hoverctl mode
which are
hoverctl mode capture --headers "User-Agent,Content-Type,Authorization"
hoverctl mode capture --all-headers
More information on hoverctl
If you are using HTTPS/TLS traffic and have not seen our last release, v0.10.3, we strongly advise looking as it provides instructions on how to replace the expired certificate.