Response Transformer plugin is unable to remove headers containing an underscore in the name

Uses: Kong Gateway
TL;DR

Why can’t the Response Transformer plugin remove a response header that contains an underscore in its name?

This is a known limitation of the Response Transformer plugin. As a workaround, add nginx_http_more_clear_headers = X_myheader to your kong.conf or environment settings, where X_myheader is the header name to remove (multiple headers can be comma-separated).

Problem

When attempting to remove a response header that contains an underscore in the name, the Response Transformer plugin is not removing the header. All other headers that do not contain the underscore are successfully removed.

Solution

The plugin is currently unable to remove a header containing an underscore in the name. However, as a workaround, the following can be added to your kong.conf or environment settings:

nginx_http_more_clear_headers = X_myheader

Where X_myheader is the name of the header to remove. Multiple headers can be specified in a comma separated list.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!