Commit e2cac80e authored by Jean-Paul Saman's avatar Jean-Paul Saman

stream_filter/httplive.c: use check username/password in relative_URI()

If a username and password are suplied, then use it when constructing the
URI.
parent 60ab123e
......@@ -348,10 +348,20 @@ static char *relative_URI(stream_t *s, const char *uri, const char *path)
return NULL;
char *psz_uri = NULL;
if (asprintf(&psz_uri, "%s://%s%s/%s", p_sys->m3u8.psz_protocol,
if (p_sys->m3u8.psz_password || p_sys->m3u8.psz_username)
{
if (asprintf(&psz_uri, "%s://%s:%s@%s%s/%s", p_sys->m3u8.psz_protocol,
p_sys->m3u8.psz_username, p_sys->m3u8.psz_password,
p_sys->m3u8.psz_host,
path ? path : p_sys->m3u8.psz_path, uri) < 0)
return NULL;
}
else
{
if (asprintf(&psz_uri, "%s://%s%s/%s", p_sys->m3u8.psz_protocol,
p_sys->m3u8.psz_host, path ? path : p_sys->m3u8.psz_path, uri) < 0)
return NULL;
return NULL;
}
return psz_uri;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment