Override Response Headers in Chrome DevTools
Modern browsers have advanced development toolkits allowing HTTP request inspection in detail. With the recent Chrome 111 release users are now able to override response headers directly in the network panel. This means tools like browser extension are not needed to accomplish simple use cases. This article is a step-by-step how-to for that DevTools override: how to add or edit a response header from the Network panel, and where the feature stops.
Motivation​
HTTP headers let the client and the server pass additional information with an HTTP request or response. This meta-information is important for a website’s functionality and security. Until now, editing HTTP headers required having access to the actual web server, which often made it difficult to quickly experiment with changes to HTTP headers.
[source: ChromeDevTools/rfcs]
Overriding a response header is a developer need that is tipically related with the following use cases:
- Debugging and troubleshooting: modifying response headers helps developers debug and troubleshoot issues by simulating different server behaviors.
- API testing and development: developers can test and handle various API responses by modifying response headers in the browser.
- Caching and performance optimization: modifying response headers allows developers to experiment with caching configurations and optimize frontend performance.
- Security: response header modification helps verify security measures and test authentication mechanisms.
- API versioning and compatibility: developers can ensure API compatibility by modifying headers and testing different API versions.
The most common case of all is CORS: a response missing Access-Control-Allow-Origin that the page is not allowed to read. How to Fix CORS Errors in Your Browser explains each CORS error message and how to unblock it while you develop.
How​
The Chrome team made it very simple this time. Here's how you can add or modify response headers:
- Open the devtools panel in the Network tab.
- Locate and open the request you wish to modify the response headers.
- Locate the
Response Headersin theHeaderspanel. - You'll see that the UI looks a little bit different from usual:
- You can click
+ Add headerto add a new response header. - You can edit existing reponse header values.
- You can click

Once you trigger the same request again your modifications are applied to the response header(s) as you can see in the highlighted sections in the screenshot above.
That's it!
Limitations​
For simple modifications the Chrome Network Panel has you covered. However if you find yourself bumping into these limitations:
- You need to easily restore overrides without having to manage chrome override files.
- You need to also modify request headers in a similar fashion.
- You need to programatically change headers (say with custom JavaScript code?).
You came to the right place, please read on!
Chrome DevTools vs tweak​
| Chrome DevTools overrides | tweak | |
|---|---|---|
| Override response headers | Yes | Yes |
| Modify request headers | No | Yes |
| What you can do to a header | Add a header or edit its value | Set, Append or Remove |
| Match many URLs with one override | Wildcards in a .headers file | Url expression or regular expression per rule |
| Works with DevTools closed | No | Yes |
| Setup | Pick a local folder for overrides and grant DevTools access | Install the extension, create a rule |
| Turn an override off | Edit or delete the override files | Toggle the rule, or stop tweak |
| Apply to every tab | No, only the inspected tab | Yes, with the Global scope |
| Change headers with your own code | No | Yes, with request hooks |
| One-click CORS, cache and CSP fixes | No | Yes, with templates |
| Browsers | Chrome and other Chromium browsers | Chrome, Edge and Firefox |
| Price | Free | Header rules are free on every plan |
If a single response header on one request is all you need, DevTools is enough. Once you need request headers, several rules at once, or overrides that survive closing DevTools, a headers only rule does the job.
Beyond browser developer tools​
Altough Chrome will cover most of your basic needs, if you're hitting on the above limitations, you can try tweak whenever you're ready.
Modify request headers​
With an intuitive table like interface you modify both request and response headers.
Programatically modify request headers​
With request hooks you can write your own custom script that modifies the specificied headers only when the request meets some criteria; for example when the URL or request body have specific keywords or content.
If you liked this article, consider sharing (tweeting) it to your followers.
Need something else? Request a feature