htransformation icon indicating copy to clipboard operation
htransformation copied to clipboard

Set header from the value of another header (logic already exists in Join)

Open shmuelarditi opened this issue 8 months ago • 3 comments

Hi, @tomMoulard first of all thanks for creating this plugin we are using it in a few places and its great.

we would be happy if we could set an header based on another header value, for example using:

- name: ip-country-headers
  spec:
    plugin:
      htransformation:
        Rules:
        - Name: copy cf-connecting-ip value to new header cf-original-connecting-ip
          type: Set
          HeaderPrefix: "^"
          header: Client-Original-Connecting-Ip
          value: "^Cf-Connecting-Ip"

        - Name: copy cf-connecting-ip value to new header cf-original-connecting-ip
          type: Set
          HeaderPrefix: "^"
          header: Client-Original-Country
          value: "^Cf-Ipcountry"

it will be a great and very useful addition, and considering there is similar logic in the Join handler i hope it wont be much work.

shmuelarditi avatar Jun 06 '24 11:06 shmuelarditi