1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-02 02:15:28 +00:00

Add slash after host. Required by URI_HTTP_REFERRER_HOST

This commit is contained in:
witekfl 2006-02-09 22:46:44 +01:00 committed by
parent e726be3a76
commit e723ddaee6

View File

@ -460,6 +460,8 @@ 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));
@ -486,7 +488,7 @@ add_uri_to_string(struct string *string, struct uri *uri,
}
if (wants(URI_HOST) && uri->hostlen) {
int add_host = 1;
add_host = 1;
#ifdef CONFIG_IPV6
/* Rationale for wants(URI_PORT): The [notation] was invented
@ -550,7 +552,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))
if ((wants(URI_DATA) || wants(URI_POST) || add_host)
&& wants(~(URI_DATA | URI_PORT))
&& get_protocol_need_slash_after_host(uri->protocol))
add_char_to_string(string, '/');