How to override response headers in Chrome DevTools, and when to use an extension instead
Since Chrome 113, DevTools can override response headers without an extension. In the Network panel, right-click a request and choose Override headers. Then edit the header, or put rules for many URLs in a .headers file under Sources › Overrides. In our test in Chrome 159, the overrides reached page loads and fetch() calls, and an added Set-Cookie was stored. They applied only in the tab whose DevTools was open, and stopped as soon as DevTools closed. They did not reach CORS preflight responses, and DevTools overrides cannot change request headers at all. For a quick look at one response, DevTools is enough. If the change has to cover requests or preflights, stay on without DevTools, or work in Firefox, use an extension.
Setting up a header override in DevTools
These steps are taken from Chrome's documentation: Override web content and HTTP response headers locally and What's new in DevTools (Chrome 113). Our test (below) set up the overrides folder through Chrome's profile settings, so we did not click through these screens ourselves.
- Open DevTools (F12), go to the Network panel and reload the page.
- Right-click the request and choose Override headers. The first time, DevTools asks you to Select folder for override files; pick an empty folder and click Allow in the bar that appears.
- Under Response Headers, hover over a value and click the edit icon to change it, or add a header of your own.
- To manage every header override in one place, open the
.headersfile under Sources › Overrides. Add override rule applies headers to many URLs with*wildcards. - Untick Enable Local Overrides in Sources › Overrides to switch them off, or click Clear to delete them.
The .headers file is JSON. This is the file we wrote by hand for the test, and Chrome 159 applied it:
[
{
"applyTo": "*",
"headers": [
{ "name": "x-added", "value": "yes" },
{ "name": "access-control-allow-origin", "value": "*" }
]
}
]
A .headers file at the top of the overrides folder applied to every site. One in a sub-folder named after the host and port, 127.0.0.1:18765/, applied to that host only. A folder named 127.0.0.1%3A18765/ did nothing.
What we measured
We tested in November 2026 with Chrome for Testing 159.0.8154.6 on Linux, and HeaderDial 0.4.0 for comparison. Chrome ran headless with a real DevTools window opened for each tab (--auto-open-devtools-for-tabs). We registered the overrides folder in the browser profile's DevTools settings with local overrides switched on, and wrote the .headers file above. Two local servers on different ports stood in for a site and its API. The HeaderDial run used response header rows with the same names and values, plus one request header, with no DevTools open. The results:
| Check | DevTools overrides | HeaderDial |
|---|---|---|
| Changed or added response header on a page load | applied | applied |
Same header read by fetch() through response.headers | overridden value | overridden value |
Set-Cookie: dtc=1; Path=/ added | cookie stored | cookie stored |
| Same tab after DevTools was closed | server's headers again | unaffected (does not use DevTools) |
| A second tab whose DevTools was closed, while the first tab kept DevTools open | server's headers | applied in every tab, unless the profile is limited to one |
Cross-origin fetch(), API sends no CORS headers, Access-Control-Allow-Origin: * added | succeeded | succeeded |
| Same, with a custom request header (needs a preflight) | blocked: the OPTIONS preflight got the server's headers | succeeded |
Add a request header (X-Debug: 1) | not possible with overrides | server received it |
For the two CORS rows we started Chrome with --disable-features=LocalNetworkAccessChecks. Both test servers ran on the same machine. While DevTools overrides were active, Chrome's local network access check blocked the call to the second port before CORS was checked, so without the flag the rows told us nothing about CORS. HeaderDial gave the same results with and without the flag. We did not test Edge, which has the same DevTools feature, or a site on the public internet.
What DevTools overrides cannot do
- Request headers. Local overrides change responses only: content and response headers. Chrome's overrides documentation describes no way to add, change or remove a request header such as
Authorization,CookieorX-Forwarded-For. Separately, the Network conditions panel can replace the User-Agent (see Chrome's documentation; we did not test it). - CORS preflights. In our test the preflight
OPTIONSresponse kept the server's headers, so a cross-origin request with a custom header or a JSON body stayed blocked. SimpleGETrequests did work. - Tabs without DevTools, or DevTools closed. Measured above: a second tab with its DevTools closed got the server's headers, and so did the first tab once its DevTools closed. A flow that opens a new tab needs DevTools open in that tab too.
- Firefox. Firefox DevTools has had Network overrides since Firefox 137. Its documentation describes replacing a response's content with a local file, for one tab, until the toolbox closes, and does not mention headers. Edit and Resend can send one request again with edited headers, but the page itself is not affected.
- The cache. Chrome's documentation says local overrides disable the browser cache while they are on, so they are no help for testing caching. See testing with Cache-Control for that.
When DevTools is the right tool
- A one-off check on one page. To try a
Content-Security-PolicyorPermissions-Policychange before you ask for a server change, an override in the Network panel is quicker than installing anything. - You also need to change the body. Local overrides can replace a script, stylesheet or JSON response with a local file. HeaderDial changes headers and URLs only, never response bodies.
- You cannot install extensions, for example on a managed work machine.
- You want it to stop by itself. Closing DevTools switches everything off, so a forgotten override cannot break your normal browsing.
When an extension is the better tool
- You need to add, change or remove request headers: an Authorization token, a feature-flag header,
Cookie,Accept-Language. - You are fixing CORS for local development and your requests need a preflight. See CORS headers for local development.
- The change must hold in every tab, without DevTools open, for example while you click through a login flow, test on a second monitor, or record a demo.
- You switch between set-ups often: HeaderDial keeps them as profiles with an Active switch, limits each to the hosts you choose, and can switch a header off after 15 min or 1 hour.
- You work in Firefox as well as Chrome or Edge. HeaderDial runs in all three from the same export.
Steps with HeaderDial
- Click the HeaderDial icon. If the site-access banner appears, choose Allow on all sites or Only <current host>. For a page on one host that calls an API on another, allow both.
- Click + Response header and enter the header and value, for example
Access-Control-Allow-Originandhttp://localhost:3000. Keep the operation on set, or choose remove to drop a header the server sends. Request headers work the same way with + Request header. - Open Where it applies, click + Only on… and choose Domain with your host, so the change stays on the site you are testing.
- Reload. The change stays in place when you close DevTools, and applies in every tab that matches the filter.
The curl equivalent
curl cannot override what a server sends back, but it shows exactly what the server sends, including the preflight answer that DevTools overrides do not change:
# the response headers the server really sends
curl -sI https://staging.example.com/
# the CORS preflight a browser would send before a request with a custom header
curl -si -X OPTIONS https://api.example.com/items \
-H "Origin: http://localhost:3000" \
-H "Access-Control-Request-Method: GET" \
-H "Access-Control-Request-Headers: x-custom"
# send a request header, which DevTools overrides cannot do
curl -H "X-Debug: 1" https://staging.example.com/
Pitfalls
- An override that seems ignored may be a preflight. Look in the Network panel for an
OPTIONSrequest just before the failing one. - A
.headersfile at the top of the overrides folder with"applyTo": "*"changes every site you open with DevTools. Put rules in the host's folder instead. - Cookies outlive the override. An added
Set-Cookieis stored like any other cookie, in DevTools or HeaderDial. Delete it under Application › Cookies when you are done. - Switch HeaderDial off afterwards. Give rows an expiry, or press Alt+Shift+D to pause every profile.
Add to ChromeFirefox: coming soon