-
Notifications
You must be signed in to change notification settings - Fork 95
Description
Hi @avarayr, I saw you left a comment on a PR (#145, comment now removed?) relating to this, so I thought I'd file a proper issue to track the suggestion.
I can definitely see use cases for transforming streams of content, and I'm open to ideas. This is indeed not supported by the current APIs, which instead block for the body before running the callbacks every time. The PR you commented on isn't really related to this as such, but it's part of a general improvement in support for streaming overall.
Do you have any thoughts on how you'd like this to work? If you can share more information about the kind of transform you're interested in that would be useful.
A relatively simple option would be to add a new kind of RequestTransform
/ResponseTransform
option, for declarative transformations instead of a callback, but whether that's possible depends on the kinds of transform you'd be doing.
Alternatively, there are certainly ways to modify the existing callback approach to support this, it's just a question of tradeoffs. I'm currently in the process of preparing some big changes for Mockttp v4 though, so if there are breaking changes required for this then now is the time to make them.