UrlParser: leading slash in path duplicates app name in RTMP stream name
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pedroSG94/RootEncoder のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
pedroSG94/RootEncoder#2213 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 43/100
pedroSG94/RootEncoder#2220 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
pedroSG94/RootEncoder#2207 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pedroSG94/RootEncoder#2203 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
pedroSG94/RootEncoder#2192 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
pedroSG94/RootEncoder の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
react/react-native#59693 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
[Submission] Viaオープンsubmit-adaption submit-adaption-violation
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
BetterAndroid/android-notification-icon-project#811 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[BUG] setTargetSourceSet scans the whole classpath once for every class, so scanning is very slowオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
sergio-sastre/ComposablePreviewScanner#156 ·
メンテナーはふだん 1 日以内に返信