Add headers by request transformer plugin not work

Hi,
I want to add some custom headers by use the request-transformer plugin, but when i try to do curl -i it looks like it didnt work. i cannot see the custom headers. So how to let it work?
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: example
config:
add:
headers:
- x-new-header: test
- x-another-header: test
plugin: request-transformer

ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: demo
annotations:
kubernetes.io/ingress.class: kong
konghq.com/plugins: echo-auth, example
spec:
rules:

  • http:
    paths:
    • path: /foo
      backend:
      serviceName: echo
      servicePort: 80

You should get more information from Kong logs. I suspect the culprit being the space between key: value

Below will work.

apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: rt-example
config: 
  add:
    headers:
    - x-new-header:test
    - x-old-header:test
plugin: request-transformer

thank you it works now. :slight_smile:


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ