📗
Janus Manual
  • Introduction
  • Installation
    • Docker
  • Quick Start
    • Authenticating
    • Add an endpoint
    • Modify (Update/Delete) an endpoint
    • Add Plugins
    • Authentication
    • Adding your API - File System
  • Clustering/HA
  • Proxy Reference
    • Terminology
    • Overview
    • Routing capabilities
    • Load Balacing
    • Request Host header
      • Using wildcard hostnames
      • The preserve_host property
    • Request URI
      • The strip_path property
      • The append_path property
    • Request HTTP method
    • Routing priorities
    • Conclusion
  • Plugins
    • Basic
    • Organization
    • Body Limit
    • Circuit Breaker
    • Compression
    • CORS
    • OAuth
    • Rate Limit
    • Request Transformer
    • Response Transformer
    • Retry
  • Auth
    • OAuth 2.0
  • Misc
    • Health Checks
    • Monitoring
    • Tracing
  • Known Issues
    • Stale HTTP Keep-Alive
  • Upgrade Notes
    • 2.x to 3.x
    • 3.6.x to 3.7.x
Powered by GitBook
On this page
  • Configuration
  • Order of execution

Was this helpful?

  1. Plugins

Response Transformer

Transform the response sent by a client on the fly on Janus, before giving it back to the client.

Configuration

The plain response transformer config:

"response_transformer": {
    "enabled": true,
    "config": {
        "add": {
            "headers": {
                "X-Something": "Value"
            }
        },
        "append": {
            "headers": {
                "X-Something-More": "Value"
            }
        },
        "replace": {
            "headers": {
                "X-Something": "New Value"
            }
        },
        "remove": {
            "headers": {
                "X-Something": ""
            }
        }
    }
}

Here is a simple definition of the available configurations.

Configuration

Description

name

Name of the plugin to use, in this case: response_transformer

config.remove.headers

List of header names. Unset the headers with the given name.

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.

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.

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.

Order of execution

Plugin performs the response transformation in following order

remove --> replace --> add --> append

PreviousRequest TransformerNextRetry

Last updated 4 years ago

Was this helpful?