Skip to content

android: make Headers and HeadersBuilder case-insensitive #2390

@Augustyniak

Description

@Augustyniak

Make operations performed by objects/structs from Headers.kt and HeadersBuilder.kt case-insensitive.

iOS change has been implemented as part of #2383.

Why is this change needed?
As it is now, it's error prone to work with Envoy headers by using non-lowercased names of the headers.

Example:

  1. An application starts request 1 with header A equal to foo and passes it to Envoy.
  2. Envoy lowercases all of the headers by default (this behavior can be disabled for h1 requests)
  3. Application's platform level filter receives request 1 with a (lowercased) header equal to foo.
  4. The filter's implementation is responsible for making sure that header A is set on all outgoing requests so its sets it on all requests.
  5. Request 1 ends up with the following headers ["a": "foo", "A": "foo"] before the filter chain finishes executing.
  6. When Envoy sees a and A headers on the request it lowercases A and joins its value with the value of a header. The over-the-wire request has the following headers ["a": "foo,foo"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions