Skip to content

Conversation

@JacksonWeber
Copy link
Contributor

Fixes #1404

This pull request enhances the handling of AUTH_USER cookies in the HttpRequestParser class and adds comprehensive test cases to validate the changes. The updates improve robustness in cookie decoding, handle edge cases gracefully, and ensure better logging for malformed cookies.

Enhancements to HttpRequestParser functionality:

  • Updated the _getId method in HttpRequestParser to decode cookies more robustly, returning null for malformed cookies or missing values, and logging warnings for decoding errors. (AutoCollection/HttpRequestParser.ts, AutoCollection/HttpRequestParser.tsL252-R264)

Addition of test cases:

  • Added a new "Cookie Decoding" test suite in HttpRequestParser.tests.ts to verify the behavior of AUTH_USER cookie handling. This includes tests for valid cookies, malformed cookies, cookies with special characters, and scenarios with missing or empty cookies. (Tests/AutoCollection/HttpRequestParser.tests.ts, Tests/AutoCollection/HttpRequestParser.tests.tsR274-R414)

Logging improvements:

@JacksonWeber JacksonWeber requested a review from hectorhdzg July 9, 2025 04:05
@JacksonWeber JacksonWeber merged commit acfbeba into microsoft:2.x Aug 26, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants