@@ -106,7 +106,7 @@ async def _perform_transaction(
106106
107107 return api_response
108108
109- async def _handle_http_message (self , http_flow : http .HTTPFlow , is_request : bool ):
109+ async def _handle_http_message (self , flow : http .HTTPFlow , is_request : bool ):
110110 # Iterate over every connected client, allowing them to intercept the message one by one such that the output
111111 # of the previous client (accepted by the provided handler) is the input of the next client.
112112 # Copy the websocket list to avoid modification during iteration.
@@ -119,9 +119,10 @@ async def _handle_http_message(self, http_flow: http.HTTPFlow, is_request: bool)
119119 requested_message_settings : MessageSetSettings = MessageSetSettings .from_json (
120120 await self ._perform_transaction (websocket , {
121121 "stage" : "pre_request" if is_request else "pre_response" ,
122- "request_summary" : _request_to_summary_json (http_flow .request ),
122+ "flow_id" : flow .id ,
123+ "request_summary" : _request_to_summary_json (flow .request ),
123124 "response_summary" :
124- _response_to_summary_json (http_flow .response ) if http_flow .response is not None else None ,
125+ _response_to_summary_json (flow .response ) if flow .response is not None else None ,
125126 })
126127 )
127128
@@ -133,17 +134,18 @@ async def _handle_http_message(self, http_flow: http.HTTPFlow, is_request: bool)
133134 message_set : MessageSet = MessageSet .from_json (
134135 await self ._perform_transaction (websocket , {
135136 "stage" : "request" if is_request else "response" ,
136- "request" : _request_to_json (http_flow .request ) if requested_message_settings .send_request else None ,
137- "response" : _response_to_json (http_flow .response ) if (requested_message_settings .send_response
138- and http_flow .response is not None ) else None ,
137+ "flow_id" : flow .id ,
138+ "request" : _request_to_json (flow .request ) if requested_message_settings .send_request else None ,
139+ "response" : _response_to_json (flow .response ) if (requested_message_settings .send_response
140+ and flow .response is not None ) else None ,
139141 })
140142 )
141143
142144 # Use the received messages.
143145 if message_set .request is not None :
144- http_flow .request = message_set .request
146+ flow .request = message_set .request
145147 if message_set .response is not None :
146- http_flow .response = message_set .response
148+ flow .response = message_set .response
147149
148150
149151addons : list [object ] = [
0 commit comments