Cannot use IPv6 addresses in remote URLs
(Originally reported to Debian. While I am using a distribution build, I believe the origin of this issue is upstream.)
When I try to enter an FTP address like ftp://[2001:db8::1234]/
for the location, I get an error saying, 'Error resolving "[2001": Name or service not known.' Similarly, when I enter an SMB address with a username like smb://example@[2001:db8::1234]/
I get an authentication prompt saying, 'Enter password for "[2001".' Both of these suggest that the URLs are not being parsed correctly.
This appears to be caused by the fact Thunar performs some URL escaping before attempting to load the URL (in thunar/thunar/thunar-path-entry.c
):
/* try to parse the URI text */
escaped_text = g_uri_escape_string (text, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, TRUE);
file_path = g_file_new_for_uri (escaped_text);
The second argument to g_uri_escape_string
is a string of characters that should not be escaped, but this does not include [
or ]
. As a result, the actual URL that Thunar attempts to load would be something like ftp://%5B2001:db8::1234%5D/
which does not work.