Skip to content

[codex] Add configurable native Referer header#8419

Open
riderx wants to merge 1 commit intoionic-team:mainfrom
riderx:codex/configurable-referer-header
Open

[codex] Add configurable native Referer header#8419
riderx wants to merge 1 commit intoionic-team:mainfrom
riderx:codex/configurable-referer-header

Conversation

@riderx
Copy link
Copy Markdown

@riderx riderx commented Apr 3, 2026

Summary

  • add a server.referer config option to Capacitor declarations
  • apply the configured Referer as a default header for native HTTP requests on Android and iOS
  • preserve per-request Referer headers and ignore invalid or non-HTTP(S) values
  • cover the config parsing and header behavior with platform tests

Why

Capacitor already supports a config-driven native user agent override, but there is no equivalent for Referer. Some integrations require a valid HTTP Referer for native requests while still allowing request-specific headers to win.

Closes #3210

Validation

  • npm run lint
  • npm --workspace android run verify
  • xcodebuild clean build -workspace Capacitor.xcworkspace -scheme Capacitor -sdk iphonesimulator -destination 'generic/platform=iOS Simulator'
  • xcodebuild clean build -scheme Cordova -sdk iphonesimulator -destination 'generic/platform=iOS Simulator'

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: send Referer header on ios

1 participant