Merged branch 'jetty-9.4.x' into 'master'.

This commit is contained in:
Simone Bordet 2016-06-03 18:03:51 +02:00
commit a300ffdc0f
3 changed files with 9 additions and 5 deletions

View File

@ -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);
}

View File

@ -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");
}
});

View File

@ -125,7 +125,7 @@ public class SharedBlockingCallback
/**
* A Closeable Callback.
* Uses the auto close mechanism to check block has been called OK.
* <p>Implements {@link Callback.NonBlocking} because calls to this
* <p>Implements {@link Callback} because calls to this
* callback do not blocak, rather they wakeup the thread that is blocked
* in {@link #block()}
*/