Request headers are the easiest surface to manipulate when reproducing API behavior. Overwriting a value, prefixing it with {{previous}}, or seeding it when missing covers most rewrite needs without duplicating headers or breaking the connection layer.
Use updateRequestHeaderAction whenever you need to change the value of an outgoing request header without inserting a duplicate copy. The action overwrites the existing value, or adds the header if addIfMissing is true. Unlike addRequestHeaderAction, which always appends, this action guarantees a single header instance after the rewrite.
Two patterns make this action especially useful:
{{previous}} placeholder to reference the original value, which lets you prepend or append data instead of replacing it.addIfMissing: true with appendSeparator to ensure a header exists, while still appending cleanly when it already does.Headers that affect the connection itself (Host, Connection, Transfer-Encoding, Content-Length, and similar) are ignored to preserve protocol integrity.
Replace whatever the client sent with a fixed identifier, useful for QA fingerprinting.
rules:
- filter:
typeKind: AnyFilter
actions:
- typeKind: UpdateRequestHeaderAction
headerName: User-Agent
headerValue: FluxzyQA/1.0
Use {{previous}} to keep the original value and add a custom suffix that downstream services can detect.
rules:
- filter:
typeKind: AnyFilter
actions:
- typeKind: UpdateRequestHeaderAction
headerName: Accept
headerValue: "{{previous}}, application/x-fluxzy-debug"
addIfMissing: true
appendSeparator: ", "
Set the header to a known client IP only if upstream proxies have not already added one.
rules:
- filter:
typeKind: HostFilter
pattern: api.example.com
actions:
- typeKind: UpdateRequestHeaderAction
headerName: X-Forwarded-For
headerValue: "{{previous}}, 203.0.113.10"
addIfMissing: true
appendSeparator: ", "
Update and existing request header. If the header does not exists in the original request, the header will be added.
Use {{previous}} keyword to refer to the original value of the header.
Note Headers that alter the connection behaviour will be ignored.
Evaluation scope defines the timing where this filter will be applied.
requestHeaderReceivedFromClient This scope occurs the moment fluxzy parsed the request header receiveid from client
updateRequestHeaderAction
The following table describes the customizable properties available for this action:
| Property | Type | Description | DefaultValue |
|---|---|---|---|
| headerName | string | ||
| headerValue | string | ||
| addIfMissing | boolean | false | |
| appendSeparator | string | Only active when AddIfMissing=true When updating an existing header, this value will be used to separate the original value and the new value. |
The following examples apply this action to any exchanges
Update the User-Agent header.
rules:
- filter:
typeKind: AnyFilter
actions:
- typeKind: UpdateRequestHeaderAction
headerName: User-Agent
headerValue: Fluxzy
View definition of UpdateRequestHeaderAction for .NET integration.
The following actions are related to this action:
It expands to the original value of the same header in the incoming request. If the header did not exist, it expands to an empty string.
addRequestHeaderAction always appends a new header instance. updateRequestHeaderAction replaces the existing value, or adds the header once when addIfMissing is true. The result is a single header line.
Connection critical headers such as Host, Content-Length, Transfer-Encoding, and Connection are filtered out to keep the protocol valid. Adjust those values with dedicated actions or by spoofing the destination.
Yes. Chain several updateRequestHeaderAction entries under the same filter, one per header. Fluxzy applies them in order.