@Test public void isDefaultPortForScheme() { assertTrue(ResponseManufacturingFilter.isDefaultPortForScheme("http", 80)); assertTrue(ResponseManufacturingFilter.isDefaultPortForScheme("https", 443)); assertFalse(ResponseManufacturingFilter.isDefaultPortForScheme("https", 8443)); assertFalse(ResponseManufacturingFilter.isDefaultPortForScheme("http", 8080)); assertFalse(ResponseManufacturingFilter.isDefaultPortForScheme("notarealscheme", 0)); assertFalse(ResponseManufacturingFilter.isDefaultPortForScheme("notarealscheme", 1003)); assertFalse(ResponseManufacturingFilter.isDefaultPortForScheme(null, 80)); }
static boolean isDefaultPortForScheme(@Nullable String scheme, int port) { @Nullable Integer defaultPort = PortsAndSchemes.getDefaultPort(scheme); return defaultPort != null && port == defaultPort.intValue(); }
ResponseManufacturingFilter extends HttpsAwareFiltersAdapter { static boolean isDefaultPortForScheme(@Nullable String scheme, int port) { @Nullable Integer defaultPort = PortsAndSchemes.getDefaultPort(scheme); return defaultPort != null && port == defaultPort.intValue(); } }
ResponseManufacturingFilter extends HttpsAwareFiltersAdapter { static boolean isDefaultPortForScheme(@Nullable String scheme, int port) { @Nullable Integer defaultPort = PortsAndSchemes.getDefaultPort(scheme); return defaultPort != null && port == defaultPort.intValue(); } <S> ResponseManufacturingFilter(HttpRequest originalRequest, ChannelHandlerContext ctx, BmpResponseManufacturer.WithState<S> responseManufacturer, BmpResponseListener responseListener); }
ResponseManufacturingFilter extends HttpsAwareFiltersAdapter { static boolean isDefaultPortForScheme(@Nullable String scheme, int port) { @Nullable Integer defaultPort = PortsAndSchemes.getDefaultPort(scheme); return defaultPort != null && port == defaultPort.intValue(); } <S> ResponseManufacturingFilter(HttpRequest originalRequest, ChannelHandlerContext ctx, BmpResponseManufacturer.WithState<S> responseManufacturer, BmpResponseListener responseListener); @Override HttpResponse clientToProxyRequest(HttpObject httpObject); @Override final HttpObject proxyToClientResponse(HttpObject httpObject); @Override HttpObject serverToProxyResponse(HttpObject httpObject); @Override void proxyToServerResolutionSucceeded(String serverHostAndPort, InetSocketAddress resolvedRemoteAddress); @Override void proxyToServerRequestSending(); @Override void proxyToServerResolutionFailed(String hostAndPort); @Override void proxyToServerConnectionFailed(); @Override void serverToProxyResponseTimedOut(); @Override HttpResponse proxyToServerRequest(HttpObject httpObject); @Override void proxyToServerRequestSent(); @Override void serverToProxyResponseReceiving(); @Override void serverToProxyResponseReceived(); @Override void proxyToServerConnectionQueued(); @Override InetSocketAddress proxyToServerResolutionStarted(String resolvingServerHostAndPort); @Override void proxyToServerConnectionStarted(); @Override void proxyToServerConnectionSSLHandshakeStarted(); @Override void proxyToServerConnectionSucceeded(ChannelHandlerContext serverCtx); }
ResponseManufacturingFilter extends HttpsAwareFiltersAdapter { static boolean isDefaultPortForScheme(@Nullable String scheme, int port) { @Nullable Integer defaultPort = PortsAndSchemes.getDefaultPort(scheme); return defaultPort != null && port == defaultPort.intValue(); } <S> ResponseManufacturingFilter(HttpRequest originalRequest, ChannelHandlerContext ctx, BmpResponseManufacturer.WithState<S> responseManufacturer, BmpResponseListener responseListener); @Override HttpResponse clientToProxyRequest(HttpObject httpObject); @Override final HttpObject proxyToClientResponse(HttpObject httpObject); @Override HttpObject serverToProxyResponse(HttpObject httpObject); @Override void proxyToServerResolutionSucceeded(String serverHostAndPort, InetSocketAddress resolvedRemoteAddress); @Override void proxyToServerRequestSending(); @Override void proxyToServerResolutionFailed(String hostAndPort); @Override void proxyToServerConnectionFailed(); @Override void serverToProxyResponseTimedOut(); @Override HttpResponse proxyToServerRequest(HttpObject httpObject); @Override void proxyToServerRequestSent(); @Override void serverToProxyResponseReceiving(); @Override void serverToProxyResponseReceived(); @Override void proxyToServerConnectionQueued(); @Override InetSocketAddress proxyToServerResolutionStarted(String resolvingServerHostAndPort); @Override void proxyToServerConnectionStarted(); @Override void proxyToServerConnectionSSLHandshakeStarted(); @Override void proxyToServerConnectionSucceeded(ChannelHandlerContext serverCtx);  }