mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #6613] [MERGED] feat(sub): make external subscription fetch User-Agent configurable #6379
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6379
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6613
Author: @mrchatam
Created: 9/19/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @MHSanaei
Base:
main← Head:feat/external-sub-custom-user-agent📝 Commits (4)
383fff4feat(sub): make external subscription fetch User-Agent configurable870e73dci: retrigger frontend after npm registry maintenancee1252c6Merge origin/main into feat/external-sub-custom-user-agent7f54dd3fix(sub): fall back to the default UA when the DB is not initialised📊 Changes
26 files changed (+161 additions, -1 deletions)
View changed files
📝
docs/public/openapi.json(+8 -0)📝
frontend/public/openapi.json(+8 -0)📝
frontend/src/generated/examples.ts(+2 -0)📝
frontend/src/generated/schemas.ts(+8 -0)📝
frontend/src/generated/types.ts(+2 -0)📝
frontend/src/generated/zod.ts(+2 -0)📝
frontend/src/models/setting.ts(+1 -0)📝
frontend/src/pages/settings/SubscriptionGeneralTab.tsx(+20 -0)📝
frontend/src/schemas/setting.ts(+1 -0)📝
internal/sub/external_subscription.go(+14 -1)📝
internal/sub/external_subscription_test.go(+55 -0)📝
internal/web/entity/entity.go(+1 -0)📝
internal/web/service/setting.go(+13 -0)📝
internal/web/translation/ar-EG.json(+2 -0)📝
internal/web/translation/en-US.json(+2 -0)📝
internal/web/translation/es-ES.json(+2 -0)📝
internal/web/translation/fa-IR.json(+2 -0)📝
internal/web/translation/id-ID.json(+2 -0)📝
internal/web/translation/ja-JP.json(+2 -0)📝
internal/web/translation/pt-BR.json(+2 -0)...and 6 more files
📄 Description
Summary
Some subscription providers reject fetches unless the request sends a known client
User-Agent. Client external subscription fetches still used a hardcodedv2rayNG/1.8.5.This adds a panel setting
externalSubUserAgent(Settings → Subscription → General) that is sent when fetching those URLs. The default remainsv2rayNG/1.8.5for backward compatibility; blank values also fall back to that default.Outbound subscriptions already support a per-row User-Agent (#6398). This covers the remaining client external-subscription path called out in #6383.
Type of change
Areas affected
How was this tested?
go test ./internal/sub/ -run 'TestFetchUsesConfiguredExternalSubUserAgent|TestFetchFallsBackToDefaultExternalSubUserAgent|TestFetchSendsStableHwid'go test ./internal/sub/ ./internal/web/service/ ./internal/web/entity/go test ./internal/web/service/ -run 'FactoryDefaults|GetAllSetting'npm run gen(zod + openapi)npm run format:checknpm run typecheckBreaking changes
None. Existing installs keep the previous User-Agent until the setting is changed.
Checklist
npm run typecheckandnpm run format:checkpass.Fixes #6383
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.