-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: add User-Agent to NetworkingModule http client #6415
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
Conversation
837db39
to
2697988
Compare
Please don't force push @cdanis. Your import will only work if we make this class public: apps-android-commons/app/src/main/java/fr/free/nrw/commons/OkHttpConnectionFactory.kt Line 53 in b9f353b
|
And yes, it fixes the problem. Thank you so much for pointing this out. Screen_recording_20250829_224847.webmPlease make that class public and push your changes. Your PR will be merged tomorrow once approved :) |
Apologies, I'm not used to force-pushes on PR branches in personal forks being a concern. I've added a new commit making the referenced class public. Thanks so much! |
All good, just fix the import as the correct import should be: import fr.free.nrw.commons.CommonHeaderRequestInterceptor Also, please remove the redundant public keyword from the |
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.
Please fix the import with this import fr.free.nrw.commons.CommonHeaderRequestInterceptor
.
Thanks for your quick help, @cdanis. It works great now and is ready to merge @nicolas-raoul :) Screen_recording_20250829_234335.mp4 |
✅ Generated APK variants! |
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 Chris for this very important fix, and Rohit for reviewing! Great collaboration. :-)
Wow! Thanks a lot Chris and Rohit. I'll submit a patch today. |
Description (required)
Fixes #6411
What changes did you make and why?
For one of the OkHttpClient.Builder()s used inside the app, the one in OkHttpConnectionFactory.kt, there's a CommonHeaderRequestInterceptor class that adds User-Agent to outgoing requests.
The same isn't true of NetworkingModule.kt. So let's try adding it there.
Tests performed (required)
None, sorry.
I don't know Kotlin, do not have Android Studio installed, and really just want to see if this builds OK using the Github Actions flow (which I tried to run locally using
act
, but ran into emulator issues I couldn't quickly diagnose).