diff --git a/components/api/src/main/java/com/hotels/styx/api/HttpMessageSupport.java b/components/api/src/main/java/com/hotels/styx/api/HttpMessageSupport.java index 2d5aeb2acd..ef08e0caa5 100644 --- a/components/api/src/main/java/com/hotels/styx/api/HttpMessageSupport.java +++ b/components/api/src/main/java/com/hotels/styx/api/HttpMessageSupport.java @@ -15,7 +15,7 @@ */ package com.hotels.styx.api; -import io.netty.handler.codec.http.HttpVersion; +import com.hotels.styx.api.messages.HttpVersion; import java.util.Optional; @@ -54,19 +54,5 @@ public static boolean keepAlive(HttpHeaders headers, HttpVersion version) { } return version.isKeepAliveDefault(); } - - public static boolean keepAlive(HttpHeaders headers, com.hotels.styx.api.messages.HttpVersion version) { - Optional connection = headers.get(CONNECTION); - - if (connection.isPresent()) { - if (CLOSE.toString().equalsIgnoreCase(connection.get())) { - return false; - } - if (KEEP_ALIVE.toString().equalsIgnoreCase(connection.get())) { - return true; - } - } - return version.isKeepAliveDefault(); - } } diff --git a/components/api/src/test/java/com/hotels/styx/api/HttpMessageSupportTest.java b/components/api/src/test/java/com/hotels/styx/api/HttpMessageSupportTest.java index fc38e2bc3d..0f8d2bd367 100644 --- a/components/api/src/test/java/com/hotels/styx/api/HttpMessageSupportTest.java +++ b/components/api/src/test/java/com/hotels/styx/api/HttpMessageSupportTest.java @@ -24,8 +24,8 @@ import static com.hotels.styx.api.HttpHeaderValues.KEEP_ALIVE; import static com.hotels.styx.api.HttpMessageSupport.chunked; import static com.hotels.styx.api.HttpMessageSupport.keepAlive; -import static io.netty.handler.codec.http.HttpVersion.HTTP_1_0; -import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; +import static com.hotels.styx.api.messages.HttpVersion.HTTP_1_0; +import static com.hotels.styx.api.messages.HttpVersion.HTTP_1_1; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is;