[vlc-devel] [PATCH] access/http: Include user/pass in redirect to icyx
Marvin Scholz
epirat07 at gmail.com
Sat Oct 28 22:52:36 CEST 2017
---
modules/access/http/resource.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/modules/access/http/resource.c b/modules/access/http/resource.c
index 4f49a4bff6..0575080a05 100644
--- a/modules/access/http/resource.c
+++ b/modules/access/http/resource.c
@@ -262,9 +262,17 @@ char *vlc_http_res_get_redirect(struct vlc_http_resource *restrict res)
/* HACK: Seems like an ICY server. Redirect to ICYX scheme. */
if ((vlc_http_msg_get_header(res->response, "Icy-Name") != NULL
- || vlc_http_msg_get_header(res->response, "Icy-Genre") != NULL)
- && asprintf(&url, "icyx://%s%s", res->authority, res->path) >= 0)
- return url;
+ || vlc_http_msg_get_header(res->response, "Icy-Genre") != NULL))
+ {
+ int ret;
+ if (res->username && res->password)
+ ret = asprintf(&url, "icyx://%s:%s@%s%s", res->username,
+ res->password, res->authority, res->path);
+ else
+ ret = asprintf(&url, "icyx://%s%s", res->authority, res->path);
+ if (ret >= 0)
+ return url;
+ }
}
/* TODO: if (status == 426 Upgrade Required) */
--
2.13.5 (Apple Git-94)
More information about the vlc-devel
mailing list