product-microgateway
product-microgateway copied to clipboard
Provide config param to preserve HTTP header case
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