Skip to content

Remove content-length header - #385

Merged
johanbrandhorst merged 1 commit into
improbable-eng:masterfrom
LeonSha:master
Apr 11, 2019
Merged

Remove content-length header#385
johanbrandhorst merged 1 commit into
improbable-eng:masterfrom
LeonSha:master

Conversation

@LeonSha

@LeonSha LeonSha commented Apr 11, 2019

Copy link
Copy Markdown
Contributor

Changes

Move the patch from envoy proxy.
https://sourcegraph.com/github.com/envoyproxy/envoy@cfc514546bc0284536893cca5fa43d7128edcd35/-/blob/source/extensions/filters/http/grpc_web/grpc_web_filter.cc#L51

Verification

I tried the patch locally and check the content-length has been removed.

@johanbrandhorst

Copy link
Copy Markdown
Contributor

Thanks for this contribution! Is there a specific issue this fixes?

This seems to be the rationale:

// Remove content-length header since it represents http1.1 payload size, not the sum of the h2
// DATA frame payload lengths. https://http2.github.io/http2-spec/#malformed This effectively
// switches to chunked encoding which is the default for h2.

Is there an envoy issue related to this?

@johanbrandhorst
johanbrandhorst self-requested a review April 11, 2019 10:05
@LeonSha

LeonSha commented Apr 11, 2019

Copy link
Copy Markdown
Contributor Author

Thanks for this contribution! Is there a specific issue this fixes?

This seems to be the rationale:

// Remove content-length header since it represents http1.1 payload size, not the sum of the h2
// DATA frame payload lengths. https://http2.github.io/http2-spec/#malformed This effectively
// switches to chunked encoding which is the default for h2.

Is there an envoy issue related to this?
envoyproxy/envoy#2946

@johanbrandhorst

Copy link
Copy Markdown
Contributor

OK, so the issue is if we have a daisy chain of proxies where this proxy will transform a HTTP/1.1 request to HTTP/2 but not remove the content-length header, then downstream proxies that receive a HTTP/2 request with a content-length header might be confused.

Thanks!

@johanbrandhorst

Copy link
Copy Markdown
Contributor

I'll merge as soon as travis has succeeded.

@johanbrandhorst
johanbrandhorst merged commit e511d30 into improbable-eng:master Apr 11, 2019
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