-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Is your feature request related to a problem? Please describe.
I'm using Hoverfly to capture some HTTP interactions, while most API I've recording are JSON, I sometimes stumble into downloading some CSV files that aren't UTF-8, leading to invalid simulations being captured/recorded.
I end up having to manually edit the captured simulation file by hand which takes some time
Describe the solution you'd like
I'd like to be able to set on the HoverflyConfig, a list of the headers should be automatically encoded into the Base64
As example
@HoverflyCapture(
config = @HoverflyConfig(
// Force Hoverfly to treat these types as binary, triggering Base64 encoding
binaryTypes = {"text/plain", "application/xml", "text/csv"}
)
)
Describe alternatives you've considered
I tried to running a middleware to edit the response to replace the Content-Type header from application application/x-csv;charset=windows-31j to application/octet-stream the middleware approach doesn't work when capturing since the response data becomes {"response":{"status":0,"body":"","encodedBody":false}, ... }
Additional context