Skip to content

Commit 8f9c31a

Browse files
committed
undertow 1.4.8.Final fix #612
1 parent 723e735 commit 8f9c31a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

jooby-undertow/src/main/java/org/jooby/internal/undertow/UndertowHandler.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636

3737
import io.undertow.server.HttpHandler;
3838
import io.undertow.server.HttpServerExchange;
39+
import io.undertow.util.HeaderValues;
40+
import io.undertow.util.Headers;
41+
import io.undertow.util.Protocols;
3942

4043
public class UndertowHandler implements HttpHandler {
4144

@@ -52,6 +55,11 @@ public UndertowHandler(final org.jooby.spi.HttpHandler handler, final Config con
5255
public void handleRequest(final HttpServerExchange exchange) throws Exception {
5356

5457
if (exchange.isInIoThread()) {
58+
HeaderValues upgrade = exchange.getRequestHeaders().get(Headers.UPGRADE);
59+
if (upgrade != null && upgrade.contains("h2c")) {
60+
// reset protocol
61+
exchange.setProtocol(Protocols.HTTP_1_1);
62+
}
5563
exchange.dispatch(this);
5664
return;
5765
}

0 commit comments

Comments
 (0)