From: Antoine Cellerier Date: Fri, 18 May 2007 14:01:38 +0000 (+0000) Subject: * modules/access/http.c: When redirecting, don't include port number in URL if it... X-Git-Tag: 0.9.0-test0~7372 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=86e662cf5572970def4bd743a5f784b7352ffaa0;p=vlc * modules/access/http.c: When redirecting, don't include port number in URL if it's using the default port. --- diff --git a/modules/access/http.c b/modules/access/http.c index 27f9b764e2..8d3bcfd705 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -1086,8 +1086,16 @@ static int Request( access_t *p_access, int64_t i_tell ) { const char *psz_http_ext = p_sys->b_ssl ? "s" : "" ; - asprintf(&psz_new_loc, "http%s://%s:%d%s", psz_http_ext, - p_sys->url.psz_host, p_sys->url.i_port, p); + if( p_sys->url.i_port == ( p_sys->b_ssl ? 443 : 80 ) ) + { + asprintf(&psz_new_loc, "http%s://%s%s", psz_http_ext, + p_sys->url.psz_host, p); + } + else + { + asprintf(&psz_new_loc, "http%s://%s:%d%s", psz_http_ext, + p_sys->url.psz_host, p_sys->url.i_port, p); + } } else {