Skip to content

Commit

Permalink
Fixes #5079 - :authority header for IPv6 address not having square br…
Browse files Browse the repository at this point in the history
…ackets.

Fixed Jenkins failures by disabling tests that require IPv6 if it is not available.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
  • Loading branch information
sbordet committed Aug 10, 2020
1 parent dd4c1db commit 867621a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Expand Up @@ -46,13 +46,15 @@
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.toolchain.test.Net;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.Callback;
import org.eclipse.jetty.util.Utf8StringBuilder;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
Expand Down Expand Up @@ -226,6 +228,8 @@ public void onFillable()
@ValueSource(strings = {"::2", "[::3]"})
public void testIPv6WithXForwardedForHeader(String ipv6) throws Exception
{
Assumptions.assumeTrue(Net.isIpv6InterfaceAvailable());

HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.addCustomizer(new ForwardedRequestCustomizer());
ConnectionFactory http = new HttpConnectionFactory(httpConfig);
Expand Down Expand Up @@ -263,6 +267,8 @@ protected void addProxyHeaders(HttpServletRequest clientRequest, Request proxyRe
@Test
public void testIPv6WithForwardedHeader() throws Exception
{
Assumptions.assumeTrue(Net.isIpv6InterfaceAvailable());

HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.addCustomizer(new ForwardedRequestCustomizer());
ConnectionFactory http = new HttpConnectionFactory(httpConfig);
Expand Down
Expand Up @@ -59,11 +59,13 @@
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.toolchain.test.Net;
import org.eclipse.jetty.util.Promise;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -467,6 +469,8 @@ protected void handleConnect(Request baseRequest, HttpServletRequest request, Ht
@MethodSource("proxyTLS")
public void testIPv6(SslContextFactory.Server proxyTLS) throws Exception
{
Assumptions.assumeTrue(Net.isIpv6InterfaceAvailable());

startTLSServer(new ServerHandler());
startProxy(proxyTLS);

Expand Down

0 comments on commit 867621a

Please sign in to comment.