Fix buildActions bug
Intro
As described in the comments, buildActions() in php/midi/src/Midi/Koala/ParseRecorded.php is using for fix http calloutbound when one connection come with multi actions. But can not adapt to condition like:
- action1
- request: GET /path/abc?...
- response: (empty response)
- action2
- request: (empty request)
- response: abc (response part1)
- action3
- request: (empty request)
- response: def (response part2) ...
abc, def are both part of whole HTTP response in only one session, it is split to multiple parts because syscall recv() need to receive twice at least to hold the entire response.
When will it appear
- A large reponse(over 64kb) in Upstream Calls
- A chunked response in Upstream Calls with Transfer-Encoding:chunked in header
Result
Can not replay correctly. In the report, response part1 in action2 was matched with 100% similarity, but reponse in action3 was tagged with "Unknown" Protocol.
Fix
original: Reqeust = action1.request, Response = action2.response; now: Request = action1.request, Response = action2.response + action3.response + ... + actionN.response