MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Can't get all headers from WebResourceRequested

Open
#1,074 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Description
I'm using WebResourceRequested like a proxy. However, it doesn't give me enough headers, causing certain request failing.
Is there any security reason for this? What's the suggested approach then?

Version
SDK: WinUI3-Reunion 0.5-prerelease
Runtime: Evergreen 89.0.774.54
Framework: WinUI
OS: Win10

Repro Steps

coreWebView2.AddWebResourceRequestedFilter("http*", CoreWebView2WebResourceContext.All);
coreWebView2.WebResourceRequested += async (s, e) =>
{
    // check e.Request.Headers here
}

Screenshots

Headers I get from DevTools, when WebResourceRequested is turned off:
image

Headers I get from the event using VS debugger:
image

There are certain headers missing, specifically Accept-Language.

Additional context

AB#32212995

Contributor guide

No contributing guide indexed for this repository

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

No repository file or test is named; start with the CoreWebView2WebResourceRequested event and the e.Request.Headers behavior shown in the repro. Investigate why Accept-Language and other headers are absent, including the security rationale, and consider the existing AB#32212995 context. Done when the supported behavior and suggested approach are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, desktop
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.