feat: add upstream request/response logging for passthrough routes#186
feat: add upstream request/response logging for passthrough routes#186
Conversation
5e86692 to
63d2dcb
Compare
| if !bytes.HasSuffix(result, []byte("\n")) { | ||
| result = append(result, []byte("\n")...) | ||
| } | ||
| // Trim trailing newline added by pretty.Pretty. |
There was a problem hiding this comment.
Was there a reson for removing trailing new line?
Viewing dumps in terminal without it is annoying.
|
I'm thinking we should perhaps hold off on this change until #166 lands. If we have a session ID then we can correlate all intercepted and passthrough routes. If you'd rather land this in the interim and then add session ID correlation later, that's fine too - in which case I'll give this a review. |
Will session ID be available in each request? Or only in requests from clients that set it? |
Only if clients set it |
If session ID is not always set I'm not sure what do you mean by session ID correlation. Traffic dumping (both intercepted or passed though) will need to work without session ID. I agree that dump file names are unfortunate for pass though routes (file names contain random UUIDs, not related to anything) but I wanted to keep the same format. Maybe different approach would be better. |

Added request/response dump functionality for passthrough routes.
RoundTripperMiddlewarein theapidumppackage.APIDumpDirmethodDrive by change