Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request body missing in OnResponse handler due to RoundTripper consumption #28

Open
trco opened this issue Aug 23, 2024 · 0 comments
Open

Comments

@trco
Copy link

trco commented Aug 23, 2024

Using RoundTripper results in the request body being consumed, which means that the request retrieved with session.Request() in the OnResponse handler is without a body. I understand that this is how RoundTripper works in Go.

Would it be reasonable to set the consumed body back to the request within gomitmproxy at this point?

I need the request body within the OnResponse handler, and currently, I'm passing it through session.SetProp here. This approach seems wrong, as I would expect the request body to be available in the OnResponse handler. However, I may be missing a reason why your code doesn't set the request body back to the request.

If you find it reasonable to add the body back to the request after RoundTripper consumes it, I'm ready to prepare a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant