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

Fix response content-length when reading from HAR files #6548

Merged
merged 8 commits into from
Dec 12, 2023

Conversation

zanieb
Copy link
Contributor

@zanieb zanieb commented Dec 12, 2023

Description

Closes #6547

Responses in flows constructed from HAR files were using the Response.make utility which resulted in the injection of content-length headers. When a content-length header existed already, this could cause failures during replay. See the linked issue or 91bc983 for a concrete example.

Checklist

  • I have updated tests where applicable.
  • I have added an entry to the CHANGELOG.

We should expose this in the future, it is painful to debug when the message gets eaten
Copy link
Member

@mhils mhils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a breeze to review with all the comments, thanks a bunch! 🍰 😃

@mhils
Copy link
Member

mhils commented Dec 12, 2023

We have a CI job that enforces that mitmproxy/net/http/headers.py has 100% coverage from test/mitmproxy/net/http/test_headers.py. Once that is resolved this is good to go! :)

@mhils mhils enabled auto-merge (squash) December 12, 2023 17:20
@zanieb
Copy link
Contributor Author

zanieb commented Dec 12, 2023

Thanks for the quick responses!

@mhils mhils merged commit 1fcd033 into mitmproxy:main Dec 12, 2023
19 checks passed
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

Successfully merging this pull request may close these issues.

HAR server replay missing content length in HEAD response
2 participants