Arawoof06 opened a new pull request, #1517:
URL: https://github.com/apache/arrow-java/pull/1517

   ## What's Changed
   
   `ServerSessionMiddleware.Factory.onCallStarted` splits the `cookie` header 
on `" ;"` (space, then semicolon) and then on every `=`. Clients send cookie 
lists as `name=value; name=value` (RFC 6265, and what `ClientCookieMiddleware` 
and the C++ Flight client produce), so as soon as any other cookie is present, 
for example a load balancer affinity cookie, the whole header becomes one token 
with two or more `=`, the loop gives up, and `arrow_flight_session_id` is never 
found. The call is then served without a session and any options set through 
`SetSessionOptions` are silently gone. A session id that itself contains `=` 
(base64 padding) is truncated and rejected with NOT_FOUND.
   
   The parser now splits on `;`, splits each pair at the first `=`, trims, 
strips surrounding double quotes, and skips a malformed entry instead of 
abandoning the rest of the header, which is what the C++ 
`ServerSessionMiddlewareFactory::ParseCookieString` does. A header holding only 
`arrow_flight_session_id=<id>` behaves exactly as before.
   
   `TestServerSessionMiddleware` covers the single-cookie, multi-cookie, 
quoted, `=`-containing, malformed, second-header, missing and unknown-id cases; 
four of them fail on `main`.
   


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