Merged branch 'jetty-9.3.x' into 'jetty-9.4.x'.
This commit is contained in:
commit
85b3459af5
|
@ -491,6 +491,12 @@ public class HttpClient extends ContainerLifeCycle
|
|||
|
||||
protected HttpDestination destinationFor(String scheme, String host, int port)
|
||||
{
|
||||
if (!HttpScheme.HTTP.is(scheme) && !HttpScheme.HTTPS.is(scheme) &&
|
||||
!HttpScheme.WS.is(scheme) && !HttpScheme.WSS.is(scheme))
|
||||
throw new IllegalArgumentException("Invalid protocol " + scheme);
|
||||
|
||||
scheme = scheme.toLowerCase(Locale.ENGLISH);
|
||||
host = host.toLowerCase(Locale.ENGLISH);
|
||||
port = normalizePort(scheme, port);
|
||||
|
||||
Origin origin = new Origin(scheme, host, port);
|
||||
|
@ -530,9 +536,7 @@ public class HttpClient extends ContainerLifeCycle
|
|||
|
||||
protected void send(final HttpRequest request, List<Response.ResponseListener> listeners)
|
||||
{
|
||||
String scheme = request.getScheme().toLowerCase(Locale.ENGLISH);
|
||||
String host = request.getHost().toLowerCase(Locale.ENGLISH);
|
||||
HttpDestination destination = destinationFor(scheme, host, request.getPort());
|
||||
HttpDestination destination = destinationFor(request.getScheme(), request.getHost(), request.getPort());
|
||||
destination.send(request, listeners);
|
||||
}
|
||||
|
||||
|
|
|
@ -271,7 +271,7 @@ public class HttpClientRedirectTest extends AbstractHttpClientServerTest
|
|||
{
|
||||
baseRequest.setHandled(true);
|
||||
response.setStatus(303);
|
||||
response.setHeader("Location", "ssh://localhost/path");
|
||||
response.setHeader("Location", "ssh://localhost:" + connector.getLocalPort() + "/path");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue