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


##########
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:
   After this change all 3 implementations of `CallHeaders.getAll(String key)` 
return an `empty iterable` (never null). So, `it` is not `null` here.
   
   The new doc string for `CallHeaders.getAll(String key)`
   ```
     /**
      * Get all values present for the given metadata key.
      *
      * @param key the metadata key
      * @return an iterable of all values for the key. Returns an empty 
iterable if no value to return.
      */
   ```
   



-- 
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