product-microgateway icon indicating copy to clipboard operation
product-microgateway copied to clipboard

Provide config param to preserve HTTP header case

Open suksw opened this issue 2 years ago • 0 comments

Describe your problem(s)

Envoy proxy by default emits HTTP header in different cases for request and response.

Request received by backend: first letter upper and the rest is lower case Response received by client: all lowercase The case does not affect the headers we dynamically add and remove via envoy proxy.

Note the testcase APIPolicyPerOperationTestCase.java in the PR https://github.com/wso2/product-microgateway/pull/2983 and that the tests are passing. If you change the cases of the constants and run the test again, the test fails.

As per the HTTP specification headers are case insensitive. Yet the above test case and a few other test cases that are not directly related are practical examples where the header case change in an inconsistant way can lead unexpected bugs.

Describe your solution

Envoy proxy has provided a way to preserve case if needed, yet this would increase memory usage. Therefore, the solution discussed was to provide a config to enable that option. https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_conn_man/header_casing

How will you implement it


Optional Fields

Related Issues:

Suggested Labels:

Suggested Assignees:

suksw avatar Jul 19 '22 06:07 suksw