Android: default User-Agent includes app name and version (#58147) - #58147
Open
crazeface wants to merge 1 commit into
Open
Android: default User-Agent includes app name and version (#58147)#58147crazeface wants to merge 1 commit into
crazeface wants to merge 1 commit into
Conversation
|
@crazeface has exported this pull request. If you are a Meta employee, you can view the originating Diff in D116705471. |
Summary: On Android, React Native's Networking module fell back to OkHttp's default User-Agent (okhttp/<version>) when no User-Agent was supplied, so requests omitted the app name and version. iOS already includes this automatically via the system networking stack. This synthesizes a default User-Agent of "AppName/Version" (or just "AppName" when no versionName is available) from the app's PackageManager, applied only when no User-Agent is otherwise set. JS-supplied User-Agent headers still take precedence. Resolves react-native-community/discussions-and-proposals#284 Changelog: [Android][Added] - Send app name and version as the default `User-Agent` header for network requests, matching iOS Differential Revision: D116705471
crazeface
force-pushed
the
export-D116705471
branch
from
August 25, 2026 19:33
19df40b to
32ffb35
Compare
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.
Summary:
On Android, React Native's Networking module fell back to OkHttp's default
User-Agent (okhttp/) when no User-Agent was supplied, so requests
omitted the app name and version. iOS already includes this automatically via the
system networking stack.
This synthesizes a default User-Agent of "AppName/Version" (or just "AppName"
when no versionName is available) from the app's PackageManager, applied only
when no User-Agent is otherwise set. JS-supplied User-Agent headers still take
precedence.
Resolves react-native-community/discussions-and-proposals#284
Changelog:
[Android][Added] - Send app name and version as the default
User-Agentheader for network requests, matching iOSDifferential Revision: D116705471