-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propagate Disable User Agent Config to Http Client #12479
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12479 +/- ##
=============================================
+ Coverage 46.87% 61.73% +14.86%
+ Complexity 948 207 -741
=============================================
Files 1829 2436 +607
Lines 96638 133220 +36582
Branches 15656 20636 +4980
=============================================
+ Hits 45300 82247 +36947
+ Misses 48104 44929 -3175
- Partials 3234 6044 +2810
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ankitsultana for the PR.
Is this change covered with any of the existing UTs? If so, it should have been failed earlier and it should pass with this change.
I am not sure how to test this via UTs. The user-agent config is passed to the Apache Commons HttpClient. After the client is created, there's no way to verify what the user-agent config value is. You can refer to Existing UTs take care of sanity testing the change. |
We can extract a method like below and add a UT for this method to check whether the
|
Since the fix is very straight forward, I'll merge it now. We can consider adding a test separately |
Created a followup issue #12519 |
In #10895 I introduced this config, but I had made an error. I never actually set this config in the final Apache HttpClient that gets created. This fixes that.
Test Plan: Several integration/unit-tests that run as part of the PR use the HttpClient so that should take care of smoke testing.
Side Note: The reason we had to do this was because we were running into a JDK bug we reported in #10894. But I think a better way to avoid this issue to set the
http.agent
system property, since the commons http-client does this: