mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Add slash after host. Required by URI_HTTP_REFERRER_HOST
This commit is contained in:
parent
e726be3a76
commit
e723ddaee6
@ -460,6 +460,8 @@ struct string *
|
|||||||
add_uri_to_string(struct string *string, struct uri *uri,
|
add_uri_to_string(struct string *string, struct uri *uri,
|
||||||
enum uri_component components)
|
enum uri_component components)
|
||||||
{
|
{
|
||||||
|
int add_host = 0;
|
||||||
|
|
||||||
/* Custom or unknown keep the URI untouched. */
|
/* Custom or unknown keep the URI untouched. */
|
||||||
if (uri->protocol == PROTOCOL_UNKNOWN)
|
if (uri->protocol == PROTOCOL_UNKNOWN)
|
||||||
return add_to_string(string, struri(uri));
|
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) {
|
if (wants(URI_HOST) && uri->hostlen) {
|
||||||
int add_host = 1;
|
add_host = 1;
|
||||||
|
|
||||||
#ifdef CONFIG_IPV6
|
#ifdef CONFIG_IPV6
|
||||||
/* Rationale for wants(URI_PORT): The [notation] was invented
|
/* 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 */
|
/* 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))
|
&& wants(~(URI_DATA | URI_PORT))
|
||||||
&& get_protocol_need_slash_after_host(uri->protocol))
|
&& get_protocol_need_slash_after_host(uri->protocol))
|
||||||
add_char_to_string(string, '/');
|
add_char_to_string(string, '/');
|
||||||
|
Loading…
Reference in New Issue
Block a user