Merge branch 'jetty-9.3.x' of github.com:eclipse/jetty.project into jetty-9.3.x

This commit is contained in:
Joakim Erdfelt 2016-06-03 10:14:12 -07:00
commit 23338db1d6
2 changed files with 8 additions and 8 deletions

View File

@ -491,6 +491,11 @@ public class HttpClient extends ContainerLifeCycle
protected HttpDestination destinationFor(String scheme, String host, int port)
{
if (!HttpScheme.HTTP.is(scheme) && !HttpScheme.HTTPS.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);
@ -525,17 +530,12 @@ public class HttpClient extends ContainerLifeCycle
*/
public List<Destination> getDestinations()
{
return new ArrayList<Destination>(destinations.values());
return new ArrayList<>(destinations.values());
}
protected void send(final HttpRequest request, List<Response.ResponseListener> listeners)
{
String scheme = request.getScheme().toLowerCase(Locale.ENGLISH);
if (!HttpScheme.HTTP.is(scheme) && !HttpScheme.HTTPS.is(scheme))
throw new IllegalArgumentException("Invalid protocol " + scheme);
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");
}
});