Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

UrlParser: leading slash in path duplicates app name in RTMP stream name

オープン 初心者向け
#2,224 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
kotlin
領域
backend

調査の方向性

まず UrlParser を見つけ、getAppName()、getFullPath()、getStreamName() を読んで、先頭のスラッシュがそれぞれのパス処理にどう影響するかを確認してください。提示された先頭スラッシュのケースをユニットテストとして追加し、アプリが live/icu、ストリームが user になることを確認してください。解析された値から期待される公開パス live/icu/user が得られれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Library version: 2.6.x – 2.8.1 (also current master). Not present in 2.5.5.

Description
When the RTMP URL path starts with an extra slash (e.g. rtmp://host:1935//live/icu/user), getAppName() and getStreamName() disagree on the path. getAppName() filters out empty segments and returns live/icu, but getStreamName() calls getFullPath().removePrefix(getAppName()) on the raw path /live/icu/user. The prefix does not match because of the leading slash, so the stream name keeps the whole path.

The server then receives app live/icu + stream live/icu/user, i.e. the published path becomes live/icu/live/icu/user. The same happens with a two-segment path: //live/user → live/live/user.

How it was found
OpenTAK ICU 1.6.0 (RootEncoder 2.6.7) publishing RTMPS to MediaMTX with path /live/icu/<user> fails. OpenTAK ICU 1.5.4 (RootEncoder 2.5.5) works with the same settings: there the result was app /live, stream icu/user. Verified on device: removing the leading slash from the path makes 1.6.0 work.

Steps to reproduce (unit test)

@Test
fun testLeadingSlashInPath() {
  val parser = UrlParser.parse("rtmp://localhost:1935//live/icu/user", arrayOf("rtmp"))
  assertEquals("live/icu", parser.getAppName())
  assertEquals("user", parser.getStreamName())   // actual: "live/icu/user"
}

Expected: stream name user, published path live/icu/user.
Actual: stream name live/icu/user, published path live/icu/live/icu/user.

Suggested fix
Normalize the path once in init, e.g. path = uri.rawPath.trimStart('/'), or derive the stream name from the same filtered segments that getAppName() uses, so both functions always see the same path.

主要言語
Kotlin
スター
3k
フォーク
946
平均マージ
3日 17時間
マージ済み PR(30日)
9

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pedroSG94/RootEncoder のほかの issue

pedroSG94/RootEncoder の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。