Polishing contribution

Closes gh-29247
This commit is contained in:
rstoyanchev
2022-10-03 17:23:02 +01:00
parent b5adae2086
commit 4d5b0c91a3
4 changed files with 37 additions and 70 deletions

View File

@@ -157,11 +157,8 @@ public class ReactorNetty2WebSocketClient implements WebSocketClient {
private HttpHeaders toHttpHeaders(WebsocketInbound inbound) {
HttpHeaders headers = new HttpHeaders();
io.netty5.handler.codec.http.headers.HttpHeaders nettyHeaders = inbound.headers();
nettyHeaders.forEach(entry -> {
CharSequence name = entry.getKey();
headers.put(name.toString(), getAll(nettyHeaders.valuesIterator(name)));
});
inbound.headers().iterator().forEachRemaining(entry ->
headers.add(entry.getKey().toString(), entry.getValue().toString()));
return headers;
}