Request Header Actions
OpenResty Edge provides the following actions to modify the client request headers.
Set the request header
Two actions are set in this page rule.
set-request-header, and this action requires the name and value of the request header to be entered.
The other action,
Use Edge Language, is intended to print the modified request header Host. the code is as follows.
true => say(req-header("Host"));
$ curl http://test.com openresty-edge.com
In this example, the request header
Host is changed from the value test.com to openresty-edge.com.
Add request header
This action also requires the name and value of the request header to be entered.
$ curl http://test.com openresty-edge
This example adds a request header with the name
X-Add-Name and the value
Remove the request header
This action has only one parameter
``bash $ curl http://test.com -H ‘X-RM-Header: openresty-edge’ (empty)
In this example, the request header with the name `X-RM-Header` is removed.