Configure HTTP Header Injection for specific URL patterns
Explanation
This policy lets you define rules that inject custom HTTP headers into web requests matching specific URL patterns. Headers injected by this policy take precedence over headers already present in the request and over modifications made by users or extensions.
A common use case for this policy is enforcing tenant access controls by injecting custom headers (for example, X-Tenant-ID).
The policy accepts a list of Rules. Each Rule contains:
* patterns: A list of URL patterns to match. For information about URL pattern format, see https://go.microsoft.com/fwlink/?linkid=2095322.
* headers: A list of header objects to inject. Each object contains:
* name: The name of the header to inject.
* value: The value of the header to inject.
If multiple rules match a request, headers from all matching rules are applied. If multiple matching rules specify the same header name, the header from the most specific URL pattern is applied. If multiple matching patterns are equally specific, the header from the rule that appears last in the list is applied.
Header names must comply with RFC 2616 (https://www.rfc-editor.org/rfc/rfc2616). Header values must not contain NUL, CR, or LF characters. Individual headers can't exceed 8 KB. Invalid headers and URL patterns are ignored.
This policy supports a maximum of 500 URL patterns across all rules. Each rule can contain up to 20 headers. URL patterns and headers that exceed these limits are ignored.
Example value:
[
{
"patterns": [
"example.com",
".example.org"
],
"headers": [
{
"name": "X-Tenant-ID",
"value": "123456"
},
{
"name": "X-Custom-Header",
"value": "CustomValue"
}
]
}
]
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\EdgeHKEY_CURRENT_USER\Software\Policies\Microsoft\Edge- Value name
- not defined in the ADMX
Enable / disable values: not defined in the ADMX (see the options below).
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Computer (HKLM)
Enable
# Enable: msedge/HttpHeaderInjection
$k = 'HKLM:\Software\Policies\Microsoft\Edge'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Configure HTTP Header Injection for specific URL patterns
Set-ItemProperty -Path $k -Name 'HttpHeaderInjection' -Value '<value>' -Type StringDisable
# Disable: msedge/HttpHeaderInjection
# No value is written in the "Disabled" state (nothing defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": msedge/HttpHeaderInjection
$k = 'HKLM:\Software\Policies\Microsoft\Edge'
Remove-ItemProperty -Path $k -Name 'HttpHeaderInjection' -ErrorAction SilentlyContinueUser (HKCU)
Enable
Disable
Revert to "Not configured"
Options (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| Configure HTTP Header Injection for specific URL patternsHttpHeaderInjection | Text boxtext | HttpHeaderInjection | REG_SZ | Max length: 1000000 |
Application
Microsoft Edge (+ Edge Update, WebView2) (Microsoft) — November 2026 templates
Official templates downloaded on November 12, 2026.