Skip to content

Preserve HTTP/1.0 versions when importing HAR files - #8535

Open
hakarrr wants to merge 5 commits into
mitmproxy:mainfrom
hakarrr:fix/har-preserve-http10
Open

hakarrr wants to merge 5 commits into
mitmproxy:mainfrom
hakarrr:fix/har-preserve-http10

Conversation

@hakarrr

@hakarrr hakarrr commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Description

HAR imports currently turn HTTP/1.0 requests and responses into HTTP/1.1 because the version mapping falls through to its default. This also affects a HAR exported by mitmproxy itself: an HTTP/1.0 message no longer retains its recorded protocol when loaded through FlowReader.

Handle HTTP/1.0 and http/1.0 explicitly for requests and responses. Existing HTTP/1.1, HTTP/2, HTTP/3, and empty-version fallback behavior is unchanged.

Tests cover the version mapping on each side, check that changing one side does not alter the other, and exercise HTTP/1.0 through an actual SaveHar to FlowReader round trip.

Validation against main 1d5d831c:

  • Six baseline failures: four direct HTTP/1.0 cases and two export/import round trips.
  • IO suite: 52 passed.
  • Tests excluding proxy: 1,567 passed, 2 skipped.
  • uv run --no-sync tox -e lint and changed-file Ruff formatting checks pass.

Tests use the existing development environment with --no-sync; the newest main dependency lock was not reinstalled for the pytest runs.

Checklist

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

hakarrr and others added 5 commits October 26, 2026 04:12
Handle HTTP/1.0 and its lowercase HAR representation explicitly rather than silently upgrading requests and responses to HTTP/1.1.

Co-authored-by: generaltony007 <[email protected]>
Test both request and response versions, HTTP/1.0 case variants, existing HTTP/1.1/2/3 and empty-version compatibility, and export-to-FlowReader round trips.

Co-authored-by: generaltony007 <[email protected]>
Note the recorded-protocol preservation fix for HAR imports.

Co-authored-by: generaltony007 <[email protected]>
@hakarrr

hakarrr commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Could you take a look at this HTTP/1.0 HAR round-trip fix when you have time? The current head has passing test, lint, type, coverage and build checks; the deployment jobs are skipped. There are no review comments to address yet. Please let me know if any changes are needed before this can be considered for merge. Thanks.

@hakarrr

hakarrr commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Hi, would you have time to review this HTTP/1.0 HAR import fix? If there's anything you'd like changed before review, I'm happy to address it. Thanks.

@hakarrr

hakarrr commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Could a maintainer review the HTTP/1.0 HAR import fix and let me know the next step? Please point out any changes needed before it can move forward, or let me know if you'd prefer it closed. Thanks.

This branch has not been deployed

No deployments
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.

1 participant