Rename Kong latency Header

Hi

We have an external company PEN testing out api gateway and one of suggestion was to disable kong specific headers.
There are two types of those:

  1. via: kong/0.13.0 - we removed it by using server_tokens = off this is good :+1:
  2. other two can be disabled but I find those very useful, ideally we would rename those :
    x-kong-proxy-latency: 77
    x-kong-upstream-latency: 320
    to something more like:
    x-gateway-proxy-latency: 77
    x-gateway-upstream-latency: 320

Do you know how to rename those ?

Looks like I found the answer to my question, solution was to rename it in constants.lua file.
/usr/local/share/lua/5.1/kong/constants.lua

Hope this would be useful trace for some in the future.

Also added this to Docker with:

RUN sed -i s/"X-Kong/"X-Gateway/g /usr/local/share/lua/5.1/kong/constants.lua

1 Like

I do the same thing, drop in my own constants.lua just because better to not expose what software is running your gateway :slight_smile: . But for Kong to make it generic would remove some of the β€œKong” brand, so I think it makes sense why they do it like so.