Commit 0e4f3d9d46609bb12ea2a79da77f0b8f2ae48d8f

Edward Thomson 2018-03-03T21:47:22

gitno_extract_url_parts: decode hostnames RFC 3986 says that hostnames can be percent encoded. Percent decode hostnames in our URLs.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/netops.c b/src/netops.c
index c74faff..fa20cba 100644
--- a/src/netops.c
+++ b/src/netops.c
@@ -238,7 +238,7 @@ int gitno_extract_url_parts(
 	if (has_host) {
 		const char *url_host = url + u.field_data[UF_HOST].off;
 		size_t url_host_len = u.field_data[UF_HOST].len;
-		git_buf_put(&host, url_host, url_host_len);
+		git_buf_decode_percent(&host, url_host, url_host_len);
 	}
 
 	if (has_port) {