Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HostHeaderHttpRequesterFilter does not work for HTTP/2 #944

Merged
merged 3 commits into from
Feb 20, 2020

Conversation

idelpivnitskiy
Copy link
Member

@idelpivnitskiy idelpivnitskiy commented Feb 20, 2020

Motivation:

HostHeaderHttpRequesterFilter adds a Host header only for HTTP/1.1.
It leads to unnecessary parsing of request-target in
H2ToStH1ClientDuplexHandler.write as an attempt to fill :authority
pseudo-header and results in missing :authority pseudo-header
required by gRPC protocol.

Modifications:

  • Do not add Host header only for HTTP/1.0 in
    HostHeaderHttpRequesterFilter;
  • Enhance HostHeaderHttpRequesterFilterTest to account for HTTP
    version;

Result:

gRPC request has :authority pseudo-header, no overhead for parsing
request-target.

Motivation:

`HostHeaderHttpRequesterFilter` adds a `Host` header only for HTTP/1.1.
It leads to unnecessary parsing of request-target in
`H2ToStH1ClientDuplexHandler.write` as an attempt to fill `:authority`
pseudo-header and results in missing `:authority` pseudo-header
required by gRPC protocol.

Modifications:

- Do not add `Host` header only for HTTP/1.0 in
`HostHeaderHttpRequesterFilter`;

Result:

gRPC request has `:authority` pseudo-header.
@idelpivnitskiy idelpivnitskiy merged commit 66db739 into apple:master Feb 20, 2020
@idelpivnitskiy idelpivnitskiy deleted the host-header-http2 branch February 20, 2020 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants