Skip to content

fix: handle typed request header maps#587

Open
Sim-hu wants to merge 3 commits into
playwright-community:mainfrom
Sim-hu:fix/request-header-shape
Open

fix: handle typed request header maps#587
Sim-hu wants to merge 3 commits into
playwright-community:mainfrom
Sim-hu:fix/request-header-shape

Conversation

@Sim-hu
Copy link
Copy Markdown

@Sim-hu Sim-hu commented Apr 10, 2026

Summary

  • make newRawHeaders() accept typed header slices such as []map[string]string
  • add unit coverage for both protocol-style and typed header payloads

Why

request.Headers() and related helpers can currently panic when the header payload is materialized as []map[string]string instead of []any. That is the failure reported in #453.

This change keeps the existing []any path working, but also accepts typed header slices produced by request event payloads and fallback overrides.

Validation

  • go test . -run 'TestNewRawHeaders'

Fixes #453

@Sim-hu Sim-hu marked this pull request as ready for review April 20, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant