Repository navigation
fix(network): do not add missing headers when looking them up - #3246
Open
Pavel Feldman (pavelfeldman) wants to merge 2 commits into
Open
Pavel Feldman (pavelfeldman) wants to merge 2 commits into
Pavel Feldman (pavelfeldman) wants to merge 2 commits into
Conversation
Pavel Feldman (pavelfeldman)
marked this pull request as ready for review
October 12, 2026 22:45
Devin Rousso (dcrousso)
approved these changes
Oct 13, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RawHeaderskept its headers in adefaultdict(dict), andget_allindexed it directly. Every lookup of a missing name stored an empty entry, so afterresponse.header_value("x-missing")the header showed up inall_headers()asNone. This affectedheader_valueandheader_valueson bothRequestandResponse.The map is now a plain dict, filled with
setdefault, andget_allreads it with.get. Lookups no longer change it. This takes the approach of #3243 a step further by dropping thedefaultdictaltogether.Test: the existing
test_response_headers_should_worknow also looks up a missing header and checks thatall_headers()doesn't gain it. It fails without the fix and passes on chromium, firefox and webkit, along with the rest oftest_network.py.Fixes: microsoft/playwright#43306