Skip to content

Reject stream URLs without a scheme during URL validation - #2219

Merged
pedroSG94 merged 1 commit into
pedroSG94:masterfrom
blihio:codex/url-missing-scheme
Oct 17, 2026
Merged

pedroSG94 merged 1 commit into
pedroSG94:masterfrom
blihio:codex/url-missing-scheme

Conversation

@blihio

@blihio blihio commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Problem

UrlParser.parse("//localhost/live/test", arrayOf("rtmp")) passes host/path validation but throws NullPointerException when the null scheme is assigned to a non-null Kotlin property.

The streaming clients catch URISyntaxException during URL validation, so this input bypasses their malformed-endpoint handling.

Change

Reject a missing scheme along with unsupported schemes using the existing URISyntaxException path.

Add two regression cases to UrlParserTest: a scheme-less hostname URL and a scheme-less IPv4 URL with an explicit port. Both fail with NPE before the fix and pass afterward.

Validation

With only this change applied to base commit 82a9cb4ee4babdc792d2ccee8b893f2b36207d40, using Gradle 9.7.1 and JDK 17:

./gradlew :common:testDebugUnitTest :encoder:testDebugUnitTest
  • common: 100 tests passed, including the existing URL parsing tests.
  • encoder: 25 tests passed.
  • git diff --check passed.

Fixes #2218

@pedroSG94
pedroSG94 merged commit f19a578 into pedroSG94:master Oct 17, 2026
1 check passed
@pedroSG94

Copy link
Copy Markdown
Owner

Thank you for the PR. Merged

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.

Scheme-less stream URLs throw NullPointerException instead of URISyntaxException

2 participants