Skip to content

Commit

Permalink
fix cookieList collection
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Apr 27, 2024
1 parent 8509ec2 commit 0d300d8
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ch.qos.logback.access.jetty;

import ch.qos.logback.access.common.spi.WrappedHttpRequest;
import ch.qos.logback.core.CoreConstants;
import jakarta.servlet.AsyncContext;
import jakarta.servlet.DispatcherType;
import jakarta.servlet.RequestDispatcher;
Expand Down Expand Up @@ -30,7 +29,6 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
Expand All @@ -40,6 +38,7 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.stream.Collectors;

import static ch.qos.logback.access.common.spi.IAccessEvent.NA;
import static java.nio.charset.StandardCharsets.UTF_8;
Expand All @@ -63,7 +62,8 @@ public String getAuthType() {
@Override
public Cookie[] getCookies() {
List<HttpCookie> httpCookies = Request.getCookies(request);
List<Cookie> cookieList = httpCookies.stream().map(httpCookie -> new Cookie(httpCookie.getName(), httpCookie.getValue())).toList();
List<Cookie> cookieList = httpCookies.stream().map(httpCookie -> new Cookie(httpCookie.getName(), httpCookie.getValue())).collect(
Collectors.toList());

return (Cookie[]) cookieList.toArray();
}
Expand Down Expand Up @@ -378,7 +378,7 @@ public RequestDispatcher getRequestDispatcher(String path) {

@Override
public int getRemotePort() {
return 0;
return Request.getRemotePort(request);
}

@Override
Expand All @@ -388,12 +388,12 @@ public String getLocalName() {

@Override
public String getLocalAddr() {
return null;
return Request.getLocalAddr(request);
}

@Override
public int getLocalPort() {
return 0;
return Request.getLocalPort(request);
}

@Override
Expand Down

0 comments on commit 0d300d8

Please sign in to comment.