jbonofre commented on code in PR #1016:
URL: https://github.com/apache/arrow-java/pull/1016#discussion_r2816933193


##########
flight/flight-core/src/main/java/org/apache/arrow/flight/client/ClientCookieMiddleware.java:
##########
@@ -100,10 +100,7 @@ public void onBeforeSendingHeaders(CallHeaders 
outgoingHeaders) {
 
   @Override
   public void onHeadersReceived(CallHeaders incomingHeaders) {
-    final Iterable<String> setCookieHeaders = 
incomingHeaders.getAll(SET_COOKIE_HEADER);
-    if (setCookieHeaders != null) {
-      factory.updateCookies(setCookieHeaders);
-    }
+    factory.updateCookies(incomingHeaders.getAll(SET_COOKIE_HEADER));

Review Comment:
   nit: if I agree with this change, it's not strictly related to the PR (just 
to keep the review focused).



##########
flight/flight-core/src/main/java/org/apache/arrow/flight/ServerSessionMiddleware.java:
##########
@@ -80,20 +80,18 @@ public ServerSessionMiddleware onCallStarted(
       String sessionId = null;
 
       final Iterable<String> it = incomingHeaders.getAll("cookie");
-      if (it != null) {
-        findIdCookie:
-        for (final String headerValue : it) {
-          for (final String cookie : headerValue.split(" ;")) {
-            final String[] cookiePair = cookie.split("=");
-            if (cookiePair.length != 2) {
-              // Soft failure:  Ignore invalid cookie list field
-              break;
-            }
-
-            if (sessionCookieName.equals(cookiePair[0]) && 
cookiePair[1].length() > 0) {
-              sessionId = cookiePair[1];
-              break findIdCookie;
-            }
+      findIdCookie:

Review Comment:
   Should not we deal with the case where `it` is `null` ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to