Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#2,224 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
kotlin
Ambito
backend

Direzione di ricerca

Inizia individuando UrlParser e leggendo getAppName(), getFullPath() e getStreamName() per confermare in che modo le barre iniziali influiscono sulla gestione dei percorsi. Aggiungi il caso fornito con barra iniziale come test unitario e verifica che l’app sia live/icu e lo stream sia user; il lavoro è completo quando i valori analizzati producono il percorso pubblicato previsto live/icu/user.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Kotlin
Stelle
3k
Fork
946
Merge medio
3g 17h
PR unite (30g)
9

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pedroSG94/RootEncoder

Tutte le issue di pedroSG94/RootEncoder

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.