microsoft / microsoft/playwright-java

[Feature]: allow to define multiple times the same header in route.fulfill

Open
#1,797 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P3-collecting-feedback
Dominant language
Java
Stars
1.6k
Forks
298
Avg merge
3d 2h
Merged PRs (30d)
14

Description

🚀 Feature Request

There is currently no way to define multiple times the same header in route.fulfill.

I first hoped I could trick it by using different cases but com/microsoft/playwright/impl/RouteImpl.java:214 uses headers.put(h.getKey().toLowerCase(), h.getValue());

I would expect that I can define headers in both ways, via Map<String, String> or via List<HttpHeader> (likewise one can use response.allHeaders() and response.headersArray()

Example

I have a test where I want to make sure that my implementation to detect multiple headers work. That's why I use route.fulfill and would like to define a header multiple times.

Motivation

see above

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with com/microsoft/playwright/impl/RouteImpl.java at line 214 and trace how route.fulfill handles Map<String, String> and List. Compare the behavior with response.allHeaders() and response.headersArray(); done means route.fulfill can preserve repeated header names through both requested input forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.