You can use the transformheaders
policy to override HTTP headers in incoming requests or outbound responses.
You can override the HTTP headers by:
-
Adding to or updating the list of headers
-
Removing headers individually
-
Defining a whitelist
"transform-headers": {
"addHeaders": [
{
"name": "X-Gravitee-Request-Id",
"value": "{#request.id}"
}
],
"removeHeaders": [
"X-Gravitee-TransactionId"
],
"whitelistHeaders": [
"Content-Type",
"Content-Length"
],
"scope": "REQUEST"
}
Add a header from the request’s payload:
"transform-headers": {
"addHeaders": [
{
"name": "X-Product-Id",
"value": "{#jsonPath(#request.content, '$.product.id')}"
}
]
"scope": "REQUEST_CONTENT"
}