11

As of 2019-11-13, the ELB LoadBalancerAttribute documentation reads

The following attributes are supported by only Application Load Balancers....

  • routing.http.drop_invalid_header_fields.enabled - Indicates whether HTTP headers with invalid header fields are removed by the load balancer (true) or routed to targets (false). The default is true.

Are the validation rules for header fields different than the rules defined in RFC 7230? If so, are the differences documented anywhere?

Edit: Jon Zobrist reports that the default is false as of 8 PM PST (Nov 13).

Community
  • 1
  • 1
VoiceOfUnreason
  • 52,766
  • 5
  • 49
  • 91

3 Answers3

4

IF your header has an underscore in it then its invalid. We faced this issue with our header which we named as app_token

VIJ
  • 1,516
  • 1
  • 18
  • 34
3

All AWS documentation seems to point to these standards: RFC 7230 section 3.2, RFC 822 section 3.1, and RFC 2616 section 4.2. So I would confidently say that No, there are no validation rules for header fields different than the rules defined in those RFCs.

As long as each header field consists of a case-insensitive field name followed by a colon (":"), optional leading whitespace, the field value, and optional trailing whitespace you should be good to go; which is basically what's defined in RFC 7230 section 3.2 (https://www.rfc-editor.org/rfc/rfc7230#section-3.2)

Fields are separated by a carriage return (CR) and a line feed (LF).

Wikipedia has a good list of standard and common non-standard header fields: https://en.wikipedia.org/wiki/List_of_HTTP_header_fields

Other RFCs links:

https://www.rfc-editor.org/rfc/rfc822#section-3.1

https://www.rfc-editor.org/rfc/rfc2616#section-4.2

Community
  • 1
  • 1
Jorge Garcia
  • 2,042
  • 23
  • 25
  • Note that underscores in header name are NOT allowed: https://forums.aws.amazon.com/thread.jspa?messageID=923182 – explunit Dec 20 '19 at 21:37
1

One place the AWS definition is currently documented : a ticket in the AWS Forum, describing the November 13 revert.

ALB removes header "access_token" from incoming request

We consider standard headers to only include alphanumeric characters and hyphens

VoiceOfUnreason
  • 52,766
  • 5
  • 49
  • 91