cleanups after merge

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2020-07-14 16:52:50 +10:00
parent df34a6269b
commit 145dcf502c
1 changed files with 1 additions and 12 deletions

View File

@ -18,9 +18,7 @@
package org.eclipse.jetty.websocket.client.impl; package org.eclipse.jetty.websocket.client.impl;
import java.net.HttpCookie;
import java.net.URI; import java.net.URI;
import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -50,22 +48,13 @@ public class JettyClientUpgradeRequest extends org.eclipse.jetty.websocket.core.
headers(fields -> request.getHeaders().forEach(fields::put)); headers(fields -> request.getHeaders().forEach(fields::put));
// Copy manually created Cookies into place // Copy manually created Cookies into place
List<HttpCookie> cookies = request.getCookies(); headers(fields -> request.getCookies().forEach(cookie -> fields.add(HttpHeader.COOKIE, cookie.toString())));
if (cookies != null)
{
// TODO: remove existing Cookie header (if set)?
headers(fields -> cookies.forEach(cookie -> fields.add(HttpHeader.COOKIE, cookie.toString())));
}
// Copy sub-protocols
setSubProtocols(request.getSubProtocols()); setSubProtocols(request.getSubProtocols());
// Copy extensions
setExtensions(request.getExtensions().stream() setExtensions(request.getExtensions().stream()
.map(c -> new ExtensionConfig(c.getName(), c.getParameters())) .map(c -> new ExtensionConfig(c.getName(), c.getParameters()))
.collect(Collectors.toList())); .collect(Collectors.toList()));
// Copy timeout from upgradeRequest object
timeout(request.getTimeout(), TimeUnit.MILLISECONDS); timeout(request.getTimeout(), TimeUnit.MILLISECONDS);
} }