HTTP Modifier


The HTTP Modifier allows to modify the HTTP traffic. This may be useful for a quick test of a website or an application without changing the server code. For example, you may add cookies to a request header or CORS headers to a server response. Using HTTP Modifier together with TCP/IP Redirector, you can implement transparent redirection of HTTP traffic from one website to another.

Note: if you need to totally change the server response, consider using the Auto-Responder instead of HTTP Modifier.

Modify What: select the Request to modify the outgoing traffic and the Response to modify the incoming traffic.

Application: type or select an application name from the list that you need to modify the HTTP traffic for. If no application name is provided, the rule will work for all applications. It is recommended to provide an application name.

Protocol: select a protocol from the list.

Match Rules: provide regexp rules to match a request or response to modify. Regexp rules are case insensitive and are applied to HTTP headers only. For the outgoing HTTP traffic, regexp rules will be applied to request headers, for incoming HTTP traffic they be applied for both; request and response headers. If more than one regexp rule is provided, all rules must match.

Regexp Samples:

Match HTTP Method and URL Part:
^GET\s+/index\.html\s+HTTP/
Match Status Code:
^HTTP/.+200
Match Host Name:
Host:.*httpdebugger\.com
Match Content Type:
Content-Type:.*text/html

Modifier Rules: provide regexp rules to modify the HTTP header and/or content. You can provide as many modifier rules as you need. Grouping ($1, $2, etc) and special symbols (\r, \n, \t) are allowed. HTTP Debugger will automatically recalculate the Content-Length of the modified content.

You can test HTTP modifier rules for outgoing HTTP traffic by visiting our View Browser Headers page.

Note: when adding a HTTP content modifier rules, make sure to provide match rules for a proper content type.

Regexp Samples:

Append New Parameter To The End Of Header:
Regex: (?=\r\n\r\n)
Value: \r\nAccess-Control-Allow-Origin: *
Delete Existing Parameter From Header:
Regex: User-Agent:.*\r\n
Value:
Replace Existing Parameter In Header:
Regex: (Content-Length:).*(?=\r\n)
Value: $1 12345
Replace HTML Tag In Content:
Regex: (<title>).*(</title>)
Value: $1 new title $2

You can create a modifier rule for a particular request/response from grid's context menu.

Note: to improve the performance, it is recommended to disable the HTTP Modifier, if it is not used.

Important: browsers tend to cache Internet connections, therefore it maybe required to restart a browser for changes to take effect.

« Back to Manual