Rethrow cookie parsing failure as IllegalArgumentException#2761
Rethrow cookie parsing failure as IllegalArgumentException#2761bulldozer-bot[bot] merged 1 commit intodevelopfrom
Conversation
Generate changelog in
|
✅ Successfully generated changelog entry!Need to regenerate?Simply interact with the changelog bot comment again to regenerate these entries. 📋Changelog Preview💡 Improvements
|
kunalrkak
left a comment
There was a problem hiding this comment.
One nit, otherwise lgtm!
| if (cookie == null) { | ||
| return Optional.empty(); | ||
| } | ||
| return Optional.of(cookie.getValue()); |
There was a problem hiding this comment.
Maybe Optional#ofNullable here?
There was a problem hiding this comment.
This value should never be null in a parsed cookie.
There was a problem hiding this comment.
hmm, how is that better implied in this code block vs using ofNullable? seems like we're handling it in the same way, just more verbose
There was a problem hiding this comment.
I personally find this way easier to read. It's consistent with the code structure other places we read cookies (the files touched in this PR) and avoids the lambda allocation.
|
Released 8.67.0 |
Before this PR
If a request contains more cookies than the configured maximum (200 by default), then the
HttpServerExchangemethods to obtain cookies will throw anIllegalStateException. This can result in false positives for internal errors monitors.After this PR
Catch these exceptions and re-throw them as
SafeIllegalArgumentException.