From c0f98c34ce9c05ffee1772209a812f6572c05e55 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sat, 11 Feb 2006 17:44:54 +0100 Subject: [PATCH] Revert witekfl's e723ddaee631 This is utterly silly and breaks plenty of stuff - Witek, you CAN'T append slashes to all hosts just because some silly referer needs it, everywhere else we NEED the hosts without slashes! --- src/protocol/uri.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/protocol/uri.c b/src/protocol/uri.c index d3979b28b..88020dcc0 100644 --- a/src/protocol/uri.c +++ b/src/protocol/uri.c @@ -460,8 +460,6 @@ struct string * add_uri_to_string(struct string *string, struct uri *uri, enum uri_component components) { - int add_host = 0; - /* Custom or unknown keep the URI untouched. */ if (uri->protocol == PROTOCOL_UNKNOWN) return add_to_string(string, struri(uri)); @@ -488,7 +486,7 @@ add_uri_to_string(struct string *string, struct uri *uri, } if (wants(URI_HOST) && uri->hostlen) { - add_host = 1; + int add_host = 1; #ifdef CONFIG_IPV6 /* Rationale for wants(URI_PORT): The [notation] was invented @@ -552,7 +550,7 @@ add_uri_to_string(struct string *string, struct uri *uri, } /* Only add slash if we need to separate */ - if ((wants(URI_DATA) || wants(URI_POST) || add_host) + if ((wants(URI_DATA) || wants(URI_POST)) && wants(~(URI_DATA | URI_PORT)) && get_protocol_need_slash_after_host(uri->protocol)) add_char_to_string(string, '/');