From 88d7f4a3998ea615c4864cebb633f458f9968dff Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Fri, 11 May 2007 23:19:34 +0000 Subject: [PATCH] http Access: Simplify the re-location code. --- modules/access/http.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/modules/access/http.c b/modules/access/http.c index 757cabe230..27f9b764e2 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -1082,22 +1082,12 @@ static int Request( access_t *p_access, int64_t i_tell ) /* This does not follow RFC 2068, but yet if the url is not absolute, * handle it as everyone does. */ - if( !strncmp( p, "/", 1 ) && ( !p_sys->psz_location || !strncmp( p_sys->psz_location, "http", 4) ) ) + if( p[0] == '/' ) { - const char *psz_http_ext; - - if( !p_sys->psz_location ) - psz_http_ext = ""; - else if( p_sys->psz_location[4] == ':' ) - psz_http_ext = ""; - else if( !strncmp( p_sys->psz_location+4, "s:", 2) ) - psz_http_ext = "s"; - else - psz_http_ext = NULL; /* Shouldn't happen */ - - if( psz_http_ext ) - asprintf(&psz_new_loc, "http%s://%s:%d%s", psz_http_ext, - p_sys->url.psz_host, p_sys->url.i_port, p); + 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); } else { -- 2.39.5