How to modify HTTP response headers
Table of Content
- Add or modify an HTTP response header
- Remove an existing HTTP response header
- Test the HTTP response header modifications
- Disable / enable a response header modification
- Remove a modification
- Append to an existing response header
Add or modify an HTTP response header
- Open ModHeader extension
- Click on the button at the top and select Response Header.
- Add the request header to add/modify on the Name and Value columns
Remove an existing HTTP response header
- To remove a response header from being sent, set the Name column only. If an existing header matches the name, it will be removed.
- If you instead wish to send an empty header, click on the "Empty header: remove" chip to change the behavior to "Empty header: send empty value". In this mode, an empty request header will be sent instead.
Test the HTTP response header modifications
Response header modifications may not show up in the network request on the developer console, since they are modified after being received through the network. You can use our headers tool to check if your modifications are being applied.
Disable / enable a response header modification
- To disable a header modification, simply uncheck the checkbox on the left side of the row.
- To reenable a header modification, simply check the checkbox again.
- To disable / enable all request header modifications, uncheck / check the checkbox next the Response Headers title.
Remove a modification
- Simply click on the X button on the right side of the row to delete.
Append to an existing response header
- By default, the modification will override the value of an existing header. To change this behavior, you can select the button on the right side of the row, then select Append instead of override. In this mode, the modification will append the value in the row to the existing header.
- In some scenarios, you may want to add a comma before appending the value. To do this, simply click on the append value chip to change the behavior to append with comma separated.
- To get back to the original override mode, simply click on the "X" button on the chip to remove the append mode.