fix host extraction from actors without paths
Ted Unangst tedu@tedunangst.com
Fri, 14 Jun 2019 16:32:10 -0400
1 files changed,
3 insertions(+),
2 deletions(-)
jump to
M
fun.go
→
fun.go
@@ -311,10 +311,11 @@ return s
} var re_unurl = regexp.MustCompile("https://([^/]+).*/([^/]+)") +var re_urlhost = regexp.MustCompile("https://([^/]+)") func originate(u string) string { - m := re_unurl.FindStringSubmatch(u) - if len(m) > 2 { + m := re_urlhost.FindStringSubmatch(u) + if len(m) > 1 { return m[1] } return ""