Skip to content

Commit

Permalink
cleanups after merge
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <[email protected]>
  • Loading branch information
lachlan-roberts committed Jul 14, 2020
1 parent df34a62 commit 145dcf5
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

package org.eclipse.jetty.websocket.client.impl;

import java.net.HttpCookie;
import java.net.URI;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -50,22 +48,13 @@ public JettyClientUpgradeRequest(WebSocketCoreClient coreClient, ClientUpgradeRe
headers(fields -> request.getHeaders().forEach(fields::put));

// Copy manually created Cookies into place
List<HttpCookie> cookies = request.getCookies();
if (cookies != null)
{
// TODO: remove existing Cookie header (if set)?
headers(fields -> cookies.forEach(cookie -> fields.add(HttpHeader.COOKIE, cookie.toString())));
}
headers(fields -> request.getCookies().forEach(cookie -> fields.add(HttpHeader.COOKIE, cookie.toString())));

// Copy sub-protocols
setSubProtocols(request.getSubProtocols());

// Copy extensions
setExtensions(request.getExtensions().stream()
.map(c -> new ExtensionConfig(c.getName(), c.getParameters()))
.collect(Collectors.toList()));

// Copy timeout from upgradeRequest object
timeout(request.getTimeout(), TimeUnit.MILLISECONDS);
}

Expand Down

0 comments on commit 145dcf5

Please sign in to comment.