Skip to content

Send version and platform in the User-Agent - #6477

Draft
geekygecko wants to merge 2 commits into
mainfrom
feature/user-agent-string
Draft

geekygecko wants to merge 2 commits into
mainfrom
feature/user-agent-string

Conversation

@geekygecko

@geekygecko geekygecko commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Description

The app now tells servers which app version and Android platform it is running on, both when it talks to Pocket Casts and when it fetches episodes from podcast hosts.

The new User-Agent strings are:

  • Calls to podcast hosts (episode streaming, downloads, artwork and transcripts): PocketCasts/<version> (Android), for example PocketCasts/8.26 (Android).
  • Calls to the Pocket Casts API: PocketCasts/<version> (Android; <platform>), where the platform is Phone, Wear OS, Automotive or TV.

Fixes https://linear.app/a8c/issue/PCDROID-869/send-pocket-castsversion-android-user-agent-when-playing-and

Testing Instructions

  1. Start playing an episode.
  2. In Logcat, check that requests to the Pocket Casts API send User-Agent: PocketCasts/<version> (Android; Phone).
  3. Check that the episode request to the podcast host sends User-Agent: PocketCasts/<version> (Android).
  4. Download an episode and check that the download request sends the same (Android) User-Agent.

Screenshots

Screenshot 2026-12-02 at 5 24 30 pm Screenshot 2026-12-02 at 5 25 54 pm

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews
  • I have updated (or requested that someone edit) the Event Horizon schema to reflect any new or changed analytics.

@geekygecko geekygecko added [Type] Enhancement Improve an existing feature. [Area] Network Things related to the web connection or communiaction labels Dec 2, 2026
@geekygecko geekygecko added this to the 8.27 milestone Dec 2, 2026
@claude

claude Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @geekygecko's task in 33s —— View job


No blocking issues. Every OkHttp client builds its User-Agent in InterceptorModule, so the new strings reach the Pocket Casts API and all podcast-host traffic (downloads, player, transcripts, artwork). The clean-and-retry header stripping still applies to them. Util.getAppPlatform caches its result and gets the application context, so building the interceptor in each @Provides call costs nothing extra.

Non-blocking

modules/features/profile/src/main/java/au/com/shiftyjelly/pocketcasts/profile/cloud/AddFileActivity.kt:747 When a user adds a file from a URL, the request still sends User-Agent: Pocket Casts because it bypasses the shared interceptors. If you want every outgoing request to use the new format, switch it to InterceptorModule.PC_PUBLIC_USER_AGENT (the profile module would need to depend on servers, or the constant could move to utils).

@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Network Things related to the web connection or communiaction [Type] Enhancement Improve an existing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants