Skip to content

Conversation

muhammad-othman
Copy link
Member

@muhammad-othman muhammad-othman commented Sep 30, 2025

Description

RequestContext.UserAgentDetails was created, and OriginalRequest.UserAgentDetails was copied to it as part of the getter. In some cases, this property is not accessed until the marshaller pipeline hanlder, which happens before the BeforeRequestEvent callback. This causes RequestContext.UserAgentDetails to miss the changes made to the original request in BeforeRequestEvent.

This PR moves the copying of UserAgentDetails from the OriginalRequest to HttpHandler, which is the final step before sending the request.

Testing

  • DRY_RUN-369ec115-0587-4ec8-ad09-a550c84d8cf6
  • Add unit test to make sure UserAgentDetails is copied correctly from the original request.
  • Tested a request with UA changes in BeforeRequestEvent callback and made sure it applies correctly.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

@muhammad-othman muhammad-othman changed the base branch from main to development September 30, 2025 16:55
@boblodgett boblodgett self-requested a review September 30, 2025 17:30
@dscpinheiro dscpinheiro merged commit 3e8a41b into development Oct 1, 2025
3 of 5 checks passed
@dscpinheiro dscpinheiro deleted the muhamoth/update-useragent-generation-ordering branch October 1, 2025 13:07
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.

3 participants