AWS Application Load Balancer transforms all headers to lower case

被刻印的时光 ゝ 提交于 2019-12-04 17:47:52

问题


I've a REST API application running in two EC2 instance and was using AWS Classic Load Balancer for a long time. The clients of REST API rely on the response headers (e.g. such as Location).

I know that HTTP headers are case-insensitive by definition, however (unfortunately) some clients are ignoring this and checking the headers in a case-sensitive way (e.g. they expect Location to start with upper case).

Recently I've changed to AWS Application Load Balancer and now I see that it transforms all response headers to lower case, as a result clients are failing to handle the response properly.

I've couple of questions here.

  1. Is it expected behavior of Application Load Balancer?
  2. Is there a way to configure it to return headers as they have been built by the application?

回答1:


It is an expected function of the ALB because HTTP/2 lowercases all headers and ALBs support HTTP/2. Unfortunately you can't modify how the headers are manipulated by the ALB.

Update: See the comments below. My statement that the ALB lowercases the request headers due to its support for HTTP/2 may not be accurate.




回答2:


This was causing our broken clients to fail when we switched from TCP ELB to HTTPS ELB.

While we fix our clients, we temporarily disabled the new ELB HTTP/2 support, which comes enabled by default.



来源:https://stackoverflow.com/questions/39871250/aws-application-load-balancer-transforms-all-headers-to-lower-case

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!