Custom header is being stripped out of the request

I send in my request a custom header called 'X-Tenant-Id` i use this to identify wich tenant the request is for.

The problem is that the header is stripped away from the request and doesn’t make it into the service. Is there a setting which allows headers so they don’t get stripped of?

Try setting “PILOT_SIDECAR_USE_REMOTE_ADDRESS” to true in pilot’s env var

How do i change this value? which configmap do i need to change for this?

I tried changing the name of the header to something without the X- but that doesn’t work either. The Tenant id is a guid in this case so i’m not sure how the remote_address setting comes in to play here?

It looks like all my custom headers are getting stripped, is there a setting somewhere that enforces this?

I would check if your VirtualService isn’t stripping your headers. We actually used it to get rid of some headers like described at https://istio.io/latest/docs/reference/config/networking/virtual-service/#Headers

This is actually wierd. Just to make sure that it’s not reaching the service turn on the debug flag for any of the flags for the istio proxy
To see options available

./istoctl proxy-config log <podname>.<namespace>

Then set any of the flags to debug for example http

./istoctl proxy-config log <podname>.<namespace> --level "http:debug"

Now hit your service with a single request and check the logs to see if the headers are coming through.

Virtual services will not strip headers unless specified explicitly in the headers config.

I think it is norm to put everything in smallcase for headers. Also custom headers need not be prepended by x- as per the recommendation of the rfc

https://tools.ietf.org/html/rfc6648

Hope that helps