Skip to content

fix: preserve transport base path when building REST polling URL - #199

Merged
shivanshtalwar0 merged 3 commits into
januscaler:masterfrom
dev-satoshi:fix/rest-polling-custom-base-path
Mar 19, 2026
Merged

shivanshtalwar0 merged 3 commits into
januscaler:masterfrom
dev-satoshi:fix/rest-polling-custom-base-path

Conversation

@dev-satoshi

@dev-satoshi dev-satoshi commented Mar 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes REST polling URL construction so janus_client no longer assumes a hardcoded /janus path.
The plugin now preserves the provided transport base endpoint path and appends only the session segment, enabling API Gateway / reverse proxy deployments with custom public paths.

Changes

  • Updated REST polling URL construction in JanusPlugin to preserve transport.url path
  • Added JanusPlugin.buildPollingUri(...) helper for consistent URI composition
  • Added tests for:
    • custom base path support
    • trailing slash normalization
    • query parameter merging
  • Removed unused extractDomainFromUrl from utils.dart
  • Updated CHANGELOG.md (2.4.3)

Benefits

  • Custom base paths are supported (e.g. /api/video/janus, /custom/path)
  • Avoids URL mismatches in API Gateway / reverse proxy topologies
  • Reduces client-side workarounds for environment-specific routing

Testing

  • Ran test/janus_plugin_test.dart
  • Added/validated buildPollingUri coverage for path/query edge cases
  • Confirmed no lint errors in modified files
  • Confirmed session creation and REST polling work without requiring a hardcoded /janus root

Breaking Changes

None — backward compatible.

Notes

API docs were not regenerated in this PR to keep review focused; a docs-only follow-up PR can be provided if needed.

Closes #198

Comment thread CHANGELOG.md Outdated
@shivanshtalwar0
shivanshtalwar0 merged commit fb6f1d4 into januscaler:master Mar 19, 2026
1 check passed
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.

2 participants