github.com/hellofresh/janus@v0.0.0-20230925145208-ce8de8183c67/docs/plugins/response_transformer.md (about)

     1  # Response Transformer
     2  
     3  Transform the response sent by a client on the fly on Janus, before giving it back to the client.
     4  
     5  ## Configuration
     6  
     7  The plain response transformer config:
     8  
     9  ```json
    10  "response_transformer": {
    11      "enabled": true,
    12      "config": {
    13          "add": {
    14              "headers": {
    15                  "X-Something": "Value"
    16              }
    17          },
    18          "append": {
    19              "headers": {
    20                  "X-Something-More": "Value"
    21              }
    22          },
    23          "replace": {
    24              "headers": {
    25                  "X-Something": "New Value"
    26              }
    27          },
    28          "remove": {
    29              "headers": {
    30                  "X-Something": ""
    31              }
    32          }
    33      }
    34  }
    35  ```
    36  
    37  
    38  Here is a simple definition of the available configurations.
    39  
    40  | Configuration                 | Description                                                         |
    41  |-------------------------------|---------------------------------------------------------------------|
    42  | name                          | Name of the plugin to use, in this case: response_transformer        |
    43  | config.remove.headers         | List of header names. Unset the headers with the given name.        |
    44  | config.replace.headers        | List of headername:value pairs. If and only if the header is already set, replace its old value with the new one. Ignored if the header is not already set.        |
    45  | config.add.headers            | List of headername:value pairs. If and only if the header is not already set, set a new header with the given value. Ignored if the header is already set.        |
    46  | config.append.headers         | List of headername:value pairs. If the header is not set, set it with the given value. If it is already set, a new header with the same name and the new value will be set.        |
    47  
    48  ## Order of execution
    49  
    50  Plugin performs the response transformation in following order
    51  
    52  `remove --> replace --> add --> append`