motiv-labs / janus

An API Gateway written in Go
https://hellofresh.gitbooks.io/janus
MIT License
2.78k stars 318 forks source link

Response_transformer not working #365

Open eloo opened 5 years ago

eloo commented 5 years ago

Hi, i'm trying to get the response transformer working but i dont get it :D The test header is simply not set :/

My Config looks like

{
    "name": "myapi",
    "active": true,
    "proxy": {
        "preserve_host": false,
        "listen_path": "/api/*",
        "upstreams": {
            "balancing": "roundrobin",
            "targets": [
                {
                    "target": "https://mytarget"
                }
            ]
        },
        "strip_path": false,
        "append_path": true,
        "methods": [
            "POST"
        ]
    },
    "plugins": [
        {
            "name": "rate_limit",
            "enabled": true,
            "config": {
                "limit": "5-M",
                "policy": "local"
            }
        },
        {
            "name": "response_transformer",
            "enabled": true,
            "config": {
                "add": {
                    "headers": {
                        "test": "test"
                    }
                }
            }
        }
    ]
}

is my config wrong? or did i miss something? thanks for your help

wklken commented 5 years ago

I also met this problem:( It seems http response headers can not be changed after serveHTTP, so how janus do this?