From f65e89dbac49f1669c2274ca4dd547b1b3722fb1 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Fri, 14 Jun 2019 16:32:10 -0400 Subject: [PATCH] fix host extraction from actors without paths --- fun.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fun.go b/fun.go index 1865845..32c2d16 100644 --- a/fun.go +++ b/fun.go @@ -311,10 +311,11 @@ func mentionize(s string) string { } 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 ""