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

fix(gateway-platforms-vertx3) Filter out Connection header when HTTP2 #498

Merged
merged 1 commit into from Aug 22, 2016

Conversation

Projects
None yet
2 participants
@msavy
Copy link
Member

msavy commented Aug 20, 2016

An endpoint MUST NOT generate an HTTP/2 message containing
connection-specific header fields

https://tools.ietf.org/html/rfc7540

This error was occurring because the backend was HTTP/1.1 and
hence we were inadvertently setting an illegal value.

Thanks to @bagder for pointing this out.

Need to do a little bit more work before I enable ALPN by default (as it's a bit fussy and needs JARs putting on the class-path and such), but this fixes a key issue.

JIRA: APIMAN-1217

fix(gateway-platforms-vertx3) For HTTP2 filter out Connection header
An endpoint MUST NOT generate an HTTP/2 message containing
connection-specific header fields

https://tools.ietf.org/html/rfc7540

This error was occurring because the backend was HTTP/1.1 and
hence we were inadvertently setting an illegal value.

JIRA: APIMAN-1217
amanResponse.getHeaders().forEach(e -> httpServerResponse.headers().add(e.getKey(), e.getValue()));
public static void buildResponse(HttpServerResponse httpServerResponse, ApiResponse amanResponse, HttpVersion httpVersion) {
amanResponse.getHeaders().forEach(e -> {
if (httpVersion == HttpVersion.HTTP_1_0 || httpVersion == HttpVersion.HTTP_1_1 || !e.getKey().equals("Connection")) {

This comment has been minimized.

@msavy

msavy Aug 20, 2016

Author Member

Slightly weird looking, but this is effectively saying >= HTTP_2

@msavy msavy changed the title fix(gateway-platforms-vertx3) For HTTP2 filter out Connection header fix(gateway-platforms-vertx3) Filter out Connection header when HTTP2 Aug 20, 2016

@EricWittmann EricWittmann merged commit e5ede02 into apiman:master Aug 22, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment