Repository navigation
Conversation
Return null when cookie-header filtering produces no values so request payloads omit the cookies field instead of serializing an empty string. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
PR risk: mediumFor commit Main concerns: reach, data sent to Sentry, public contract. This label is a hint for reviewers, not an approval. |
📲 Install BuildsAndroid
|
4 of 9 tasks
adinauer
marked this pull request as ready for review
November 27, 2026 12:29
adinauer
requested review from
0xadam-brown and
romtsn
and removed request for
a team
November 27, 2026 12:29
romtsn
reviewed
Nov 27, 2026
| } | ||
| } | ||
| return filteredHeaders; | ||
| return filteredHeaders.isEmpty() ? null : filteredHeaders; |
Contributor
There was a problem hiding this comment.
theoretically we could assign it to null and only initialize an ArrayList inside the for-loop in the first iteration. This would avoid unnecessary allocation and simplify this to just return filteredHeaders, but that's a micro-optimization so up to you :)
romtsn
approved these changes
Nov 27, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Stack (Remove sendDefaultPii)
📜 Description
Return
nullwhen cookie-header filtering produces no values. Request integrations then omit thecookiesfield instead of serializing it as an empty string when a request has no cookie headers.All current SDK callers already handle a nullable filtered result, so no integration-specific fallback is needed.
💡 Motivation and Context
The removal of
sendDefaultPiimakes cookie filtering run consistently across Servlet and Spring request integrations. For requests without cookie headers, the shared helper previously returned an empty list, which callers joined intoRequest.cookies = "".Omitting the field accurately represents the absence of cookie data and avoids passing an empty collection into callers that expect either values or
null.💚 How did you test it?
make format api.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
None.