From eae0287466020b5b5aee137fb4599136420f89a2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 27 Feb 2009 19:20:11 +0100 Subject: song_print: hide HTTP password in playlist Added the uri_remove_auth() library function which strips username and password from a HTTP URI, and use it in song_print_url(). This allows you to add HTTP URIs to the playlist including secret username and password, without disclosing it to all MPD clients. --- src/uri.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/uri.h') diff --git a/src/uri.h b/src/uri.h index 6a20e94a4..1189cb227 100644 --- a/src/uri.h +++ b/src/uri.h @@ -30,4 +30,13 @@ bool uri_has_scheme(const char *uri); const char * uri_get_suffix(const char *uri); +/** + * Removes HTTP username and password from the URI. This may be + * useful for displaying an URI without disclosing secrets. Returns + * NULL if nothing needs to be removed, or if the URI is not + * recognized. + */ +char * +uri_remove_auth(const char *uri); + #endif -- cgit v1.2.3